cyntler / react-doc-viewer

File viewer for React.
https://cyntler.github.io/react-doc-viewer
Apache License 2.0
396 stars 127 forks source link

PDF: error when packaged using Electron #238

Open warpdesign opened 7 months ago

warpdesign commented 7 months ago

I am attempting to use react-doc-viewer with an Electron application. When trying to view a pdf document, it fails and I see this warning in the console:

tiny-warning.esm.js:11 Warning: Error: Setting up fake worker failed: "Cannot load script at: file://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js".

Is there a way to not rely on external url for the pdf worker? There is no way my app will download random some js from an external url (and it does even require an internet connection).

I saw this issue but it has been closed without much explanation.

cyntler commented 6 months ago

@warpdesign Try to use the latest version: https://github.com/cyntler/react-doc-viewer/releases/tag/v1.15.0

phosha commented 4 months ago

@warpdesign Try to use the latest version: https://github.com/cyntler/react-doc-viewer/releases/tag/v1.15.0

I'm trying to use the latest version (1.16.5), but it's still using external urls, maybe I'm doing something wrong? изображение