Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load module with react native #21

Open
fannarjr opened this issue Nov 12, 2024 · 3 comments
Open

Can't load module with react native #21

fannarjr opened this issue Nov 12, 2024 · 3 comments

Comments

@fannarjr
Copy link

Hi, I'm trying to import scribe using react but to no avail.

Tried doing it with a clean install, from scratch:

npx create-react-app my-app

then in my-app folder:

npm i scribe.js-ocr

which installs the module but when I try to import scribe, VS Code shows me the following text on hover:

"Could not find a declaration file for module 'scribe.js-ocr'. 'c:/projects/pdfreader/aws/bakvinnsla-pdfreader/frontend/node_modules/scribe.js-ocr/scribe.js' implicitly has an 'any' type.
If the 'scribe.js-ocr' package actually exposes this module, try adding a new declaration (.d.ts) file containing declare module 'scribe.js-ocr';ts(7016)"

Then when I try npm start I get a bunch of module not found errors.

Tried to do it clean since I got the same error on an already developing project that uses native react.

Anyways, props to you, have been comparing your project to tesseract and you give significantly better results.

All the best,

@Balearica
Copy link
Contributor

I'm glad you're getting better results than with Tesseract.

Unfortunately, React Native is not supported. Significant components of Scribe.js are implemented in WebAssembly. Despite WebAssembly being universally supported in browser and server environments for years, React Native still does not have support for WebAssembly (see facebook/hermes#429). This limitation also applies to Tesseract.js (see naptha/tesseract.js#709).

@fannarjr
Copy link
Author

ok thanks for the reply, I can run Tesseract on my app though, was just hoping for an upgrade. In any case I'll keep a look out and even if I feel like, revamp to make it compatible. :I

@fannarjr
Copy link
Author

oh, my bad. am not using React Native, its CRA (Create React App.) Guess that's why Tesseract works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants