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
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
It works fine when using tesseract.js as a dependency in development mode, but throws error in production build. I did some investigation and found it looks like the browser field in package.json does not map correctly in production build.
This can be temporally fixed via patch-package to the tesseract.js package on the line where it switches import. Wondering if this could be fixed on the vite side or by adding extra configuration.
Describe the bug
It works fine when using
tesseract.js
as a dependency in development mode, but throws error in production build. I did some investigation and found it looks like the browser field in package.json does not map correctly in production build.browser field: https://github.com/naptha/tesseract.js/blob/90466c3b5504a9220ba0ff91ccec22003f72cbd2/package.json#L29-L31
where it was loaded: https://github.com/naptha/tesseract.js/blob/90466c3b5504a9220ba0ff91ccec22003f72cbd2/src/createWorker.js#L14
This can be temporally fixed via
patch-package
to thetesseract.js
package on the line where it switches import. Wondering if this could be fixed on the vite side or by adding extra configuration.Reproduction
https://github.com/rainy-me/vite-tesseract-reproduction
System Info
vite
version: v2.0.5Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: