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

TypeError: r.slice(0,500).join is not a function #797

Closed
jiabochao opened this issue Jul 16, 2023 · 2 comments
Closed

TypeError: r.slice(0,500).join is not a function #797

jiabochao opened this issue Jul 16, 2023 · 2 comments

Comments

@jiabochao
Copy link

Tesseract.js version ("tesseract.js": "^4.1.1",)

Describe the bug

The following error occurs when running in a CapacitorJS iOS application, but it works fine in a PC browser.

Error: TypeError: r.slice(0,500).join is not a function. (In 'r.slice(0,500).join(" ")', 'r.slice(0,500).join' is undefined)

To Reproduce
Steps to reproduce the behavior:

const ret = await worker.value.recognize(blob);

Please attach any input image required to replicate this behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Device Version:

  • OS + Version: iOS 16.2
  • Browser "@capacitor/ios": "^5.0.2",

Additional context
Add any other context about the problem here.

@Balearica
Copy link
Member

Balearica commented Jul 16, 2023

Were you previously able to use CapacitorJS with another version of Tesseract.js and experienced this when updating Tesseract.js, or was this the only version tested on?

Additionally, let me know if your repo is public or if there's some sample repo this could be replicated on. I am not familiar with CapacitorJS and do not own an iPhone, so any assistance replicating would be appreciated.

@jiabochao
Copy link
Author

I had been using the File object provided by @capawesome/capacitor-file-picker plugin API, but it appears to be incompatible with the browser’s File object, so I switched to use the browser’s input file upload and now it’s working fine on the iOS app as well.

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