You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the feature relevant to the Firefox PDF Viewer?
No
Feature description
[I'm Guessing this isn't a supported platform, but I'm logging an issue for posterity and for other people to find, etc.]
I can't seem to get pdf.js to work from an iOS React Native app. I tried both the modern build and the legacy build. With either one I get an error while bundling like:
error: node_modules/pdfjs-dist/legacy/build/pdf.mjs: node_modules/pdfjs-dist/legacy/build/pdf.mjs:Invalid call at line 16572: import( /*webpackIgnore: true*/_this46.workerSrc)
I think React Native has to resolve all dynamic imports at compile time, so you can't import from a variable. So I tried manually modifying node_modules/pdfjs-dist/legacy/build/pdf.mjs and hardcoding it to import('./pdf.worker.mjs'), but it still doesn't work. For some reason the bundler hangs at 99.7%:
This discussion was converted from issue #18732 on September 11, 2024 05:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is the feature relevant to the Firefox PDF Viewer?
No
Feature description
[I'm Guessing this isn't a supported platform, but I'm logging an issue for posterity and for other people to find, etc.]
I can't seem to get pdf.js to work from an iOS React Native app. I tried both the modern build and the legacy build. With either one I get an error while bundling like:
I think React Native has to resolve all dynamic imports at compile time, so you can't import from a variable. So I tried manually modifying
node_modules/pdfjs-dist/legacy/build/pdf.mjs
and hardcoding it toimport('./pdf.worker.mjs')
, but it still doesn't work. For some reason the bundler hangs at 99.7%:I am not sure why or how to debug further. 🤷 Any tips / suggestions welcome.
Other PDF viewers
No response
Beta Was this translation helpful? Give feedback.
All reactions