Tesseract.js can no longer find the WASM file on Vercel

Hello everyone,

I’m experiencing an issue with Tesseract.js on my project deployed on Vercel. Until recently, everything was working fine, but now, for no apparent reason, Tesseract can no longer find the required WASM file (tesseract-core-simd.wasm).

Context

  • Version used: Tesseract.js v6
  • Environment: Nuxt 3 project hosted on Vercel
  • History: My code was previously working without any issues, and OCR processing was running fine.

Error encountered

When calling createWorker() to run OCR analysis, I now get the following error:

php

CopierModifier

Aborted(Error: ENOENT: no such file or directory, open '/var/task/node_modules/tesseract.js-core/tesseract-core-simd.wasm')
Uncaught Exception: Error [RuntimeError]: Aborted(Error: ENOENT: no such file or directory, open '/var/task/node_modules/tesseract.js-core/tesseract-core-simd.wasm').
    at n (/var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:13:225)
    at Ma (/var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:14:143)
    at /var/task/node_modules/tesseract.js-core/tesseract-core-simd.js:14:491
Node.js process exited with exit status: 129.

Questions

  • Has anyone else encountered this issue on Vercel?
  • Has there been a recent change that prevents Tesseract.js from accessing the WASM file?
  • Is there any specific configuration needed in vercel.json or elsewhere to ensure the file is accessible?

Any help would be greatly appreciated!

Best regards,

Hi @captainfr, welcome to the Vercel Community!

Sorry that you’re facing this issue. Can you share what is the project name? Did you try using the fixed version for Tesseract.js in package.json? The one when it worked fine for you.

It is very hard to debug the issue without looking at the code. Can you please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.

I have created a small minimalist project on GitHub that reproduces my issue. While the GitHub project uses a standard Node.js setup, I am running on Nuxt.js. However, the errors in the logs are exactly the same. Thanks!

Here is the link: