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
I cannot get pdf-to-img working, I get the following error
The file does not exist at "/node_modules/.vite/deps/build/pdf.worker.mjs?worker_file&type=module" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to optimizeDeps.exclude.
In another project I solved it by importing
import * as pdfjsLib from "pdfjs-dist/webpack";
Would that be an option?
The text was updated successfully, but these errors were encountered:
I'm having a similar issue - I'm not using it on the frontend, but instead in a Next.js / Webpack backend. I still get the same error:
Failed to parse document: Atel letter.pdf Error: Setting up fake worker failed: "Cannot find module '/sites/web/.next/server/vendor-chunks/pdf.worker.mjs' imported from /sites/web/.next/server/vendor-chunks/pdfjs-dist.js".
at eval (webpack-internal:///(rsc)/../node_modules/pdfjs-dist/legacy/build/pdf.mjs:8581:36)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I cannot get pdf-to-img working, I get the following error
The file does not exist at "/node_modules/.vite/deps/build/pdf.worker.mjs?worker_file&type=module" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to
optimizeDeps.exclude
.In another project I solved it by importing
import * as pdfjsLib from "pdfjs-dist/webpack";
Would that be an option?
The text was updated successfully, but these errors were encountered: