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

Syntax Error in Internet Explorer 11 (Angular) #425

Closed
PLPatrick opened this issue Mar 6, 2020 · 2 comments
Closed

Syntax Error in Internet Explorer 11 (Angular) #425

PLPatrick opened this issue Mar 6, 2020 · 2 comments

Comments

@PLPatrick
Copy link

PLPatrick commented Mar 6, 2020

Hi Jerome,

I have a problem with Tesseract, let me explain it:

I use Tesseract.js in an Angular App.
And when I open it on : http://localhost:4200/ in Internet Explorer 11, I have a white page and a syntax error (I see it in the developer tools).
On other browsers I have no problem.

It seems that Tesseract is not transpiled.
I expect Tesseract to be transpiled and work on IE 11.

Some details:

  • OS: Windows
  • Browser: Internet Explorer
  • Browser version: 11

The syntax error points to:

const recognize = async (image, langs, options) => {
  const worker = createWorker(options);
  await worker.load();
  await worker.loadLanguage(langs);
  await worker.initialize(langs);
  return worker.recognize(image)
    .finally(async () => {
  await worker.terminate();
});

I target es5 in my tsconfig.json :

"target": "es5",
"lib": [
  "es2017",
  "es6",
  "dom"
 ]

I opened the same issue here : tesseract.js-angular-app/issues/6.

Thank you in advance for taking the time to answer my problem.
Cheers, Patrick.

@jeromewu
Copy link
Member

jeromewu commented Mar 9, 2020

To use tesseract.js, you need to use browser that at least support asm.js.
As IE 11 doesn't support asm.js, it is impossible to make it work.
Ref: https://caniuse.com/#feat=asmjs

@jeromewu jeromewu closed this as completed Mar 9, 2020
@crayolakat
Copy link

@PLPatrick I am using Tesseract v1.0.10 for compatibility with IE

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

3 participants