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

Script fails to work, says ReferenceError: File is not defined #28

Closed
ShakesVision opened this issue Jan 18, 2025 · 1 comment
Closed

Comments

@ShakesVision
Copy link

I get this error whenever trying to run the script. I've cloned it locally and still face the same issue.

Error occurred:
ReferenceError: File is not defined
    at Lens.scanByData (file:///C:/<username>/workspace/Node/chrome-lens-ocr/src/core.js:224:22)  
    at Lens.scanByBuffer (file:///C:/<username>/workspace/Node/chrome-lens-ocr/src/index.js:68:21)
    at async cli (file:///C:/<username>/workspace/Node/chrome-lens-ocr/cli.js:67:16)
    at async file:///C:/<username>/workspace/Node/chrome-lens-ocr/cli.js:92:9

I ran the following command from the root:
node cli.js .\004_resized.jpg

File is not available in Node (it's for DOM) if I understand this correctly - and hence the error.

Suggestion:
Can you add an example folder in the repo which uses the local version of scripts and does the OCR? That way we can at least try to reproduce the running env by copying the exact script and node version and understand the problem with our setup.

Thanks for all the work!

@dimdenGD
Copy link
Owner

Your Node.js version is too old

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