Replies: 1 comment
-
Check out this answer on stack overflow: https://stackoverflow.com/questions/79044550/how-to-use-pdfjs-worker-in-react-and-typescript |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently having issues with pdfjs-dist latest version (4.8.69). In our webapp (react-ts-webpack) we already have an old version of the lib (2.6.347).
As we compile ES5 code for legacy requirements, I needed to first parse the files with babel, to be able to import them.
Now my main issue is about the worker setup. I tried different approaches:
Import
webpack.mjs
from thebuild/
folder as stated in the WIKI.Build correctly, error in the console import.meta.url can't be used outside module
But with the new files:
Build correctly too, but in the console it throws an error about importing an ESM module in a .cjs file
Error in the console about
__webpack_require__
being an empty object (error is:could not call property .d of undefined, reading __webpack_require__.d()
)Does someone had similar issues? Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions