tesseract.js: Error on iOS 17: RuntimeError: call_indirect to a null table entry

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

Describe the bug On iOS 17’s Safari/WebKit, when Tesseract.recognize is called, the following runtime error will occur:

Error: RuntimeError: call_indirect to a null table entry (evaluating '(Rf=b._emscripten_bind_TessBaseAPI_Recognize_1= b.asm.Gd).apply(null,arguments)')

This does not occur on devices running iOS 16, or any other desktop OS/browser.

To Reproduce Steps to reproduce the behavior:

  1. Set up Tesseract on a Nextjs project
  2. Visit Next website on an iOS device running iOS 17
  3. Upload image
  4. See error

Image used to generate error: Example_Schedule

Expected behavior Tesseract will recognize the text in the image and output successfully.

Device Version:

  • OS + Version: iOS 17 beta 4
  • Browser: Safari/any WebKit browser

Additional context I have created a repo to assist in reproduction, available here

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 34

Most upvoted comments

To close the loop on this–this issue appears to be fixed by Apple in iOS 17.2 (see #867). Therefore, the fix described above (avoiding the Legacy model) is only relevant for iOS 17.0 and 17.1. If somebody can produce this error on iOS 17.2 onward, please open a new issue.

Closing this issue as Tesseract.js v5 has been released, which should be fully compatible with iOS 17 by default (as it only uses the LSTM model by default). If any users encounter issues with iOS 17, upgrading to v5 should resolve.

I will open a new Git Issue regarding how the Legacy engine is still not compatible with iOS 17, however I doubt many users use the Legacy model, so that is a much smaller issue.

Makes sense, thanks for reporting. Can follow up closer to the release of iOS 17.