Overview
The default PDF previewer engine in the Web client is called PDFTron. When a PDF file that you want to preview has JavaScript in it, previewing it for a second time (select it, select another document, select it again) throws the JavaScript error below in the browser console, and the preview may have issues (e.g., content depending on the JavaScript in the PDF may be missing).
Error message:
webviewer-core.min.js:1 Uncaught (in promise) TypeError: t[i].onTriggered is not a function
at e.fa.pa.t.eg (webviewer-core.min.js:1)
at e.bc (webviewer-core.min.js:1)
at e.sC (webviewer-core.min.js:1)
at webviewer-core.min.js:1
at Array.forEach (<anonymous>)
at e.fa.hf.Rg (webviewer-core.min.js:1)
at webviewer-core.min.js:1
at Array.forEach (<anonymous>)
at webviewer-core.min.js:1
at webviewer-core.min.js:1
Solution
Upgrade M-Files Server to the September 2023 (23.9) release.
Workaround
You can set the Viewer Type for the Web Client to "Browser" to avoid this issue:
