After running npm install, you need to copy the PDF.js worker file to make PDF processing work:
Copy-Item -Path "node_modules\pdfjs-dist\build\pdf.worker.min.mjs" -Destination "public\pdf.worker.min.mjs"cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdf.worker.min.mjsThe PDF.js library requires a web worker to process PDF files. This worker must be served from the public directory so it can be loaded by the browser.
You can add this to your package.json scripts:
{
"scripts": {
"postinstall": "cp node_modules/pdfjs-dist/build/pdf.worker.min.mjs public/pdf.worker.min.mjs || copy node_modules\\pdfjs-dist\\build\\pdf.worker.min.mjs public\\pdf.worker.min.mjs"
}
}This will automatically copy the worker file after every npm install.