# When first load i always got this error message

**URL:** https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845
**Category:** Bug Reports
**Tags:** pdfjs-express
**Created:** [June 24, 2021, 3:04am UTC](https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845 "2021-06-24T03:04:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tony](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/tony/32/427_2.png) [@tony](https://pdfjs.community/u/tony)
#### Post date: [June 24, 2021, 3:04am UTC](https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845/1 "2021-06-24T03:04:25Z")

</div>

Error:

 ![2021-06-24_09-46-37](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/642cb3b89b72b63c14e625473cd7d1e6d3373f2c.jpeg)

My Code is like this below. Look like it working fine, but i really dont want the error detect when we are in production environment.

```javascript
// init load to make new instance available
    useEffect(() => {
        viewer(
            {
                path: "/resources/public/webviewer/lib",
                initialDoc: "/resources/public/files/PDFTRON_about.pdf"
            },
            viewerRef.current
        ).then(instance => {
            setInstance(instance);
        });
    }, []);

    // when the file ready to load to viewer
    useEffect(() => {
        if (getDocFile && instance && getFileName) {
            extractXFDF();
            instance.loadDocument(base64ToBlob(getDocFile), { filename: getFileName });
            setFirstLoadReady(true);
        }
    }, [getDocFile, instance, getFileName]);

    // when the load is ready, set the save button as header
    useEffect(() => {
        if (firstLoadReady) {
            instance.setHeaderItems(header => {
                header.push({
                    type: "actionButton",
                    img:
                        '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>',
                    onClick: async () => {
                        setLoadingAnimation(true);
                       
                        setFirstLoadReady(false);

                        funcPageCount();
                    }
                });
            });
        }
    }, [firstLoadReady]);

```

---

<div class="post-metadata">

### Author: ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)
#### Post date: [June 25, 2021, 3:46pm UTC](https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845/2 "2021-06-25T15:46:27Z")

</div>

Hi there,

It looks like you are using an older version of PDF.js Express. Are you able to reproduce this error with the latest version (7.3.3)?.

This error comes up when some PDF.js Express resources can not be loaded properly. Please ensure all assets are being served correctly and that your `path` argument is correct.

Logan

---

<div class="post-metadata">

### Author: ![tony](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/tony/32/427_2.png) [@tony](https://pdfjs.community/u/tony)
#### Post date: [June 27, 2021, 1:31pm UTC](https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845/3 "2021-06-27T13:31:35Z")

</div>

thank you, look like the error gone when i upgrade to a new version.

---

<div class="post-metadata">

### Author: ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)
#### Post date: [June 29, 2021, 2:30pm UTC](https://pdfjs.community/t/when-first-load-i-always-got-this-error-message/845/4 "2021-06-29T14:30:35Z")

</div>


