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

Maximum call stack size exceeded #853

Open
RaenonX opened this issue Nov 17, 2023 · 1 comment
Open

Maximum call stack size exceeded #853

RaenonX opened this issue Nov 17, 2023 · 1 comment

Comments

@RaenonX
Copy link

RaenonX commented Nov 17, 2023

Tesseract.js version (version number for npm/GitHub release, or specific commit for repo)
v5.0.3

Describe the bug
Unable to run. Console showing maximum call stack size exceeded.

To Reproduce
Steps to reproduce the behavior:

const worker = await createWorker(
  'eng',
  OEM.DEFAULT,
  {
    errorHandler: (error) => {
      console.error('OCR Error', error);
    },
  },
);
await worker.setParameters({
  tessedit_char_blacklist: '$§',
  tessedit_char_whitelist: whitelistChars,
});

Images below show what's captured in F12. The 17435 and the regex part is my compiled code, I don't know where the octet-stream from, but it seems to

image
image

In the image above that shows the console output, 2 0-height errors show (under 2 jsdelivr, the red bar) up immediately after the worker starts. the octet-stream one shows up about a minute later.


Image below was the target image to recognize.

image

Expected behavior
No error.

Device Version:

This doesn't work:

  • OS + Version: SE3 iOS 16.7.1
  • Browser: Safari/604.1

This works:

  • OS + Version: Windows 11
  • Browser: 119.0.2151.58 (Official build) (64-bit)

Additional context
Add any other context about the problem here.

Note

  • I understand that the whole thing might be vague, making it hard to debug, but I've tried what I can do...because my updates in a fast pace, I can't tell exactly when it started breaking.
  • This only happens on old iPhone devices it seems. I don't have an old iPhone (this only happens on older iPhones) so it was tested by my friend.
  • During my update from v5.0.0 to v5.0.3, I added the option of tessedit_char_whitelist and that's it (besides some hidden canvas for storing image data).
@Balearica
Copy link
Collaborator

I attempted to replicate this issue but was unable to do so. I used an iPhone SE 2020 v16.4, which was the closest device provided by Browserstack to what you describe. I recognized the provided image on the Tesseract.js demo site, and everything worked as intended.

I would have your friend try and recognize the image on the Tesseract.js demo site. This would help determine if the issue is specific to some settings used in your project, or if Tesseract.js consistently encounters issues on that particular device/software combination.

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