Error during fetch i18n files in Electron

WebViewer Version: 8.1.0

Do you have an issue with a specific file(s)?
Can you reproduce using one of our samples or online demos? no
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? yes, electron
Is your issue related to annotations? no

Please give a brief summary of your issue:
Error during fetch i18n files in Electron

Please describe your issue and provide steps to reproduce it:

In electron environment, we report the following error when the WebViewer initializes:

The Fetch API cannot load … traslation-en.json the URL schema file is not supported.

This is due to the fact that PDFJSDocumentType attempts a fetch () on the file, but this is not supported.

Is there any way to solve the problem?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hello i.catanzaro,

Welcome to the PDFTron community forum!

I noticed theres a typo in The Fetch API cannot load … traslation-en.json the URL schema file is not supported. it should be translation-en.json, this could possibly be the issue. Where was this error located?

Could you also post a screenshot of the console and network tab? as this could be a CORS issue

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com

My mistake, the typo has nothing to do with it.

Attached is a print of the console.

PDFJSDocumentType attempts a fetch with a url of type “file: //”. and fails (remember we are in Electron environment).

In web environment is all ok.

WebViewer inizialization:

Schermata 2021-10-02 alle 08.52.52

Hello i.catanzaro,

Thank you for reaching out.

Since this issue relates to PDFJS Express, the next thing to do is to post on its community forum: https://pdfjs.community/

Let me know if you have any further questions.

Best Regards,
Tyler Gordon
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com