I'm getting this issue after deploying my code on vercel;it was working completely fine in my local environment. I'm not able find solution for this problem anywhere.
Aborted(Error: ENOENT: no such file or directory, open '/var/task/node_modules/tesseract.js-core/tesseract-core-simd.wasm') 2023-01-04T06:54:46.648Z 7c70e537-4119-465d-924c-f90026df64fc ERROR Uncaught Exception {"errorType":"RuntimeError","errorMessage":"Aborted(Error: ENOENT: no such file or directory, open '/var/task/node_modules/tesseract.js-core/tesseract-core-simd.wasm'). Build with -sASSERTIONS for more info.","stack":["RuntimeError: Aborted(Error: ENOENT: no such file or directory, open '/var/task/node_modules/tesseract.js-core/tesseract-core-simd.wasm'). Build with -sASSERTIONS for more info."," at n (/var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:18:375)"," at Ua (/var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:19:317)"," at /var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:20:394"]} Unknown application error occurred Runtime .Unknown
I used tesseract.js
package and it was working good on my local environment, but not on Vercel production server
Based on the above, I think that the problem is that you are importing createWorker
try to change the import to
and then use it like