-
-
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
Unexpected token < #134
Comments
Had the same issue. Solved by switching from NPM version to CDN version. EG, remove |
Can someone shed some light on this? Adding a CDN isn't the best solution @SidneyNemzer removing the import won't solve this though. At least using angular 4. |
Same here, tried using 1.5RC2 version of |
I am having the same issue in a react app. Anyone get this to work yet? |
Did switching to the CDN not fix it, @BrianTatum? I'm not sure why it seems to have worked only for me... Obviously that's not a long term fix. Just a temporary fix to get it working for now. |
Indeed as @SidneyNemzer suggests, using the version from CDN works, but for TypeScript newcomers it may seem as a no-no, as we'd like to make use of PS Have a double look at how you invoke Tesseract worker methods. In my case, I was missing an obvious |
I am not sure if I am getting the image like file set correctly from some
of the reading that I have done today. Is there a good example of getting
the file set to pass into Tesseract?
Update: I am trying to use this in a React app so the cdn will not work with my build. It has to be Imported. Also tried the React component call Dropzone to get the file. I can place the file in an image tag on the page, but still get the same error.
|
@BrianTatum What do you mean exactly by file set? Afaik Dropzone is only another way to provide your API endpoint with some form data, so you'd need to get the location/name of this just uploaded file and pass it to Besides, I guarantee you don't have to import it into your React module to get this working via CDN, as React itself is a framework added within In case it's still not clear, get us some code so we can have a look at it and eventually help. |
Hey typescripters! I did a tiny and nice package solving this issue here: tesseract.ts. // npm i -S tesseract.ts tesseract.js
import {Tesseract} from "tesseract.ts"; |
@urakozz thanks for the package, solved this issue. |
With version 1.0.10
When using the Simple example of the documentation i got:
Uncaught SyntaxError: Unexpected token <
at blob:http://localhost:3000/49b8248d-3fa6-4529-a4bc-532adde1c6cc:1
(anonymous) @ blob:http://localhost:3000/49b8248d-3fa6-4529-a4bc-532adde1c6cc:1
The text was updated successfully, but these errors were encountered: