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: path must be a string #48

Open
donkey13 opened this issue May 31, 2017 · 2 comments
Open

TypeError: path must be a string #48

donkey13 opened this issue May 31, 2017 · 2 comments

Comments

@donkey13
Copy link

binding.open(pathModule._makeLong(path),
^
TypeError: path must be a string
at TypeError (native)
at Object.fs.open (fs.js:491:11)
at Object.fs.readFile (fs.js:262:6)
at C:\node_modules\node-tesseract\lib\tesseract.js:90:12

is anyone can help to figure out what's problem?

@SPlatten
Copy link

SPlatten commented Jun 5, 2017

Can you post a bit more of the source code, at least the rest of the parameters, there isn't much to go on...but it looks like path isn't a string and open() expects it to be.

@matteocontrini
Copy link

Same issue here. I can't generate a consistent reproduction case but it sometimes happen in my production application, and it crashes the process. It seems that the files variable here is an empty array. That could happen only if tesseract fails and doesn't output any file.

The problem here is that this cannot be controlled by the application using the module. It can't even be try-catched. There should be a check for truthy-ness when passing files[0] to fs.readFile.

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