-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cannot read property 'arrayBuffer' of undefined (Electron & React) #449
Comments
You mentioned: Failed to execute 'importScripts' and been able to use relative paths on remaining config also, keep on the fence, the option is supposedly to be suppressed according to a code comment on spawnWorker.js |
Hi @gnonio thanks for taking the time to look at this issue. That actually got me to the next step, importing from a relative path isn't erroring anymore, but the new errors are:
This seems to be happening a lot from some of the issues I've seen on here. This is using the offline scripts (I believe) from the relative path, so I don't understand how I'm now getting this error. Most of the time when you see this error, it's fixed when using offline scripts. Any ideas on this one? If I remove the |
It's a little beyond me now, but I did had langPath issues with the offline build. If I remember correctly It was having difficulty in finding osd.traineddata.gz at some point which is not a language itself but part of the Orientation and Script Detection (OSD), these were only present in 4.0.0_fast langPath. At the time CSP issues were also hitting which I solved on the extension manifest side, but I duplicated those files in 4.0.0 and 4.0.0_best and I think I got rid of one of those errors. If you are getting undefined this could be it. |
Thanks @gnonio, I appreciate the help. I can't seem to get past where I'm at currently, so I'll just leave this issue open. |
I had exactly same issues and spent some hours on figuring out the problem. In my case I was using: https://electron-react-boilerplate.js.org/docs/adding-dependencies @karlhadwen According to your https://github.com/karlhadwen/notes/blob/master/package.json you are also using this "Two Package Structure" but you dont have any The issue resolved for me when:
|
@schrufygroovy hmm, I don't have a |
https://github.com/schrufygroovy/score-archive/tree/for-karl PS: What I figured out is that the cached |
Did you resolve it? I have same problem with electron+vue |
Can't say the above solved it for me, I kind of just gave up. |
It seems fetch traineddata response is undefined. when langPath is https://tessdata.projectnaptha.com/4.0.0 everything ok , but error when langPath is localhost |
@karlhadwen When I try fallback version to 2.0.0, it's ok , it seems a bug of v2.1.1 |
@jeromewu Actually,when I fallback version to v2.0.1, this problem still exist. After review source code,it seems because of replace axios to fetch? I'm not sure,I'm new of web. |
I'm having the same problem with Electron.js + Vue.js : #465 |
I think everyone is having a similar problem, I spent hours on it but got nowhere. Maybe one of the authors can help? |
Version 2.0.0. is ok: #465 (comment) |
Have the same problem. After HOURS of trying, it has to be the traineddata file being corrupted. When i hard refresh electron, it always works on the first scan and fails on each consecutive with abort(undefined) when using local files. |
@Shiuyin in that scenario with corrupted traineddata file you can try: |
Hi, are exist some news about this issue ? When I read the code the problem is due to the commit on getEnvironment.js where electron is introduced. After that this code |
When we are in a webview where the url is load from another side that electron itself the isElectron must be return false, isn't it ? So the web app in the webview could use the fetch of the browser |
Please check v2.1.4 for the fix of this issue. 😄 |
Describe the bug
I've spent a few hours tonight trying to get tesseract.js working with an application I've been building. The stack is Electron & React and I can't seem to get it to work, I've pulled both the Electron & React example applications and they seem to work fine, but with my application, I'm bundling React inside Electron--which I think might be causing this issue.
At first, my application wasn't loading the languages with the default setup, so I went ahead and moved to the offline tesseract. To do this, I used Webpack to copy the files from the node_modules to my
build
folder usingcopy-webpack-plugin
, this works fine, so then I went ahead and created the worker like so:Note: If I remove
http://localhost:3000/
- I getUncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The URL '/static/vendor/worker.min.js' is invalid.
After running the application with the steps below, I get the following error:
Uncaught (in promise) TypeError: Cannot read property 'arrayBuffer' of undefined
- I've spent a few hours trying to debug this, but to no avail. ThelangPath, workerPath, corePath
all seem correct, and I can access these directly in the browser.I'm kind of stumped at this point, any help would be appreciated.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To read the data from the image in 'http://localhost:3000/note.png' - which is the example image.
Screenshots
App.js: https://github.com/karlhadwen/notes/blob/master/src/App.js
electron.js: https://github.com/karlhadwen/notes/blob/master/public/electron.js
.webpack.config.js: https://github.com/karlhadwen/notes/blob/master/.webpack.config.js
Desktop (please complete the following information):
Additional context
Repo where this is happening: https://github.com/karlhadwen/notes/
The text was updated successfully, but these errors were encountered: