Please give a brief summary of your issue:
In recent updates to Chrome (v97) WebAssembly code used in the PDFTron SDK no longer works/executes successfully.
The specific error I am getting states: Uncaught (in promise) CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder PDFworker.js?isfull=true&disableLogs=0&wasm=1:72
Please describe your issue and provide steps to reproduce it:
Create a webviewer using the fullApi setting. Try to view a document in the latest version of Chrome or Edge. (Not seeing this problem in Mozilla Firefox).
Suggested solutions include this most common one: Wasm module compile error in Chrome Extension. I am currently working to implement this in the webconfig of our Angular front-end, but I wanted to create a topic about it in case anyone else is encountering it, has encountered it, or if there is a better solution than changing the Content Security Policy.
I am currently using Chrome Version 97.0.4692.71 (Official Build) (64-bit), and I am unable to see this error on a default WebViewer installation with fullAPI: true
Are you able to provide a sample project with the Angular implementation that has this issue?
Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc. www.pdftron.com
Unfortunately the repo that I made to reproduce the error didn’t have the error… , but this seems to be specifically related to our Content Security Policy, because after I tweaked our ‘script-src’ policy the WASM code / PDFWorker.js file now process / execute fine. Chalking this up to the Content Security Policy in our webconfig file.