Product: WebViewer
Product Version: 7.3.3
Please give a brief summary of your issue:
Getting an error of “both async and sync fetching of the wasm failed” after upgrading to WebViewer v7.3.3
Please describe your issue and provide steps to reproduce it:
I am working on a React app that integrates with the WebViewer via npm. We were using v6.3.3 successfully. After upgrading to v7.3.3, I get an error when I try to use PDFTron to process and print documents. I am able to initialize the WebViewer object and get back the webviewer “instance”, but when I call anything on the “instance”, I get the error of:
MemGrow.js:1 Uncaught (in promise) RuntimeError: abort(RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info.
at abort (file:///C:/xxx/pdftron/core/pdf/simple_wasm/MemGrow.js:1:12233)
at file:///C:/xxx/pdftron/core/pdf/simple_wasm/MemGrow.js:1:14298
I downgraded back down to 6.3.3, and everything worked fine again.
Do you have any suggestions on what might be wrong, or how to maybe address it?
Unfortunately I’m having trouble reproducing your issue. Here are the steps I took:
- Clone the webviewer-react-sample repo GitHub - PDFTron/webviewer-react-sample: Sample to demonstrate integrating WebViewer into React
- Run
npm install
and then npm start
- Open localhost:3000 and see the document load in Chrome and confirm from the console it’s WebViewer 7.3.3
Are you able to see any issues when following these steps?
You may want to try clearing your browser cache to make sure that isn’t causing any issues. You may also want to try this approach when updating versions https://www.pdftron.com/documentation/web/faq/load-webviewer-files-no-cache/
Thank you for the reply, Matt.
I cloned the “webviewer-react-sample”, and also the "webviewer-electron-sample’ repositories, and was able to successfully run the WebViewer using versions 7.3.3 and 8.0.0. So I did not see any issues using those sample repositories.
The project I’m working on in based on this boilerplate project here, GitHub - electron-react-boilerplate/electron-react-boilerplate: A Foundation for Scalable Cross-Platform Apps. I cloned a new repo from that project, and installed PDFTron to work in that sample. I was successfully able to run PDFTron using versions 6.3.3, 7.3.3, and 8.0.0.
These experiments lead me to believe that the problem is something unique to the project I’m working on.
I tried clearing out my browser caches, and that did not change the error I am getting.
Console messages:
I will continue trying to resolve and get my project upgraded to version 7.3.3 or above, and will reply if I find out any more information about the cause of the problem. If you have any more suggestions or ideas, they would appreciated. Thank you for your time.
Thanks for the update. Unfortunately we haven’t encountered that error message before so let us know if you’re able to narrow the issue anymore.
We’re having exactly the same issue as described. We are using Ionic/Capacitor to generate the electron app.
The memgrow.js error only appears when we try to create freetext or callout annotations and then try to download the document. Using version 8.1.0 shows the error already at load of the document. We used “ems” or “wasm-threads” as backend.
The problem sadly persists. Did you find a solution meanwhile?
I’m not sure if they were able to find a solution but if you’re able to provide a reproducible sample project then we could investigate it further on our end.