Replies: 1 comment
-
It's an esbuild issue (or pdf.js issue depending on your point of view), see here: #17245. |
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 trying to build and dynamically import pdf.js v4.0.189 in an Angular 17 project using esbuild.
It used to work with pdf.js v3.11.174 and webpack.
When building the project I'm getting an error:
I've tried to wrap line 16837 in /node_modules/pdfjs-dist/build/pdf.mjs with an invoked function:
Now I'm able to build but when trying to dynamically import the module pdfjsLib.GlobalWorkerOptions and all other attributes are undefined:
Is it ok to manually wrap the line with
(async () => {})();
?Is there a way to dynamically import pdfjsLib in esbuild project and set pdfjsLib.GlobalWorkerOptions.workerSrc?
Beta Was this translation helpful? Give feedback.
All reactions