PDFTRON is breaking after manual deployment to the IIS server

  1. Build: “Ni8zMC8yMDIyfDM4OGZiODQyMA==”
  2. Core version: “8.6.1”
  3. Full API: true
  4. UI version: “8.6.1”
  5. WebViewer Server: false
  6. webviewer.min.js: “8.6.1”

Warning in Console
webviewer-core.min.js:215 Your server has not been configured to serve WebAssembly threads. See PDFTron Systems Inc. | Documentation for instructions on how to resolve this.
y @ webviewer-core.min.js:215
PDFworker.js:67 Failed to load full/optimized/PDFNetCWasm.br.js.mem
t @ PDFworker.js:67
PDFworker.js:67 Failed to load full/optimized/PDFNetCWasm.gz.js.mem
t @ PDFworker.js:67
PDFworker.js:67 There may be some degradation of performance. Your server has not been configured to serve .gz. and .br. files with the expected Content-Encoding. See PDFTron Systems Inc. | Documentation for instructions on how to resolve this.

Error
Uncaught SyntaxError: Unexpected token ‘<’
at f (PDFworker.js:96:251)
at r (PDFworker.js:239:430)
at g.onmessage (PDFworker.js:252:84)
main.e41a202cabfc0961.js:299 ERROR Error: Uncaught (in promise): WorkerError: The worker has encountered an error
WorkerError: The worker has encountered an error
at new r (webviewer-core.min.js:734:221)
at Array. (webviewer-core.min.js:632:221)
at Object.trailing (webviewer-core.min.js:644:53)
at Ya (webviewer-core.min.js:132:83)
at Worker.lb (webviewer-core.min.js:132:473)
at z (polyfills.f071dc4bb771a3b4.js:1:15964)
at polyfills.f071dc4bb771a3b4.js:1:15047
at polyfills.f071dc4bb771a3b4.js:1:15202
at v.invoke (polyfills.f071dc4bb771a3b4.js:1:6543)
at Object.onInvoke (main.e41a202cabfc0961.js:299:149207)
at v.invoke (polyfills.f071dc4bb771a3b4.js:1:6483)
at M.run (polyfills.f071dc4bb771a3b4.js:1:1939)
at polyfills.f071dc4bb771a3b4.js:1:16775
at v.invokeTask (polyfills.f071dc4bb771a3b4.js:1:7161)
at Object.onInvokeTask (main.e41a202cabfc0961.js:299:149023)

Hello,

As the error has pointed out, it seems you have not configured your server for the threaded workers to work. You will have to follow the documentation to have it enabled or switch off threaded workers with backendType: ‘ems’ in your constructor.

Also, please ensure you have the right mime types set on your server as well: PDFTron Systems Inc. | Documentation.