You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are currently many issues related to how Tesseract.js handles errors within workers. For example, the issues below are all either directly about promises never resolving, or are more difficult to troubleshoot because promises never resolve (no error message in the main thread).
While we could implement smaller bug fixes for many of these, the larger issue appears to be that error messages are only reported from the worker threads to the main thread when caught and sent using res.reject. This means that any error that does not trigger a res.reject call will not be reported.
Reworking to use the worker.onerror event would likely be more robust, and make it impossible for error messages to slip through the cracks in the future.
The text was updated successfully, but these errors were encountered:
See #662 for explanation of Tesseract.js Version 4 changes. List below is auto-generated from commits.
* Added image preprocessing functions (rotate + save images)
* Updated createWorker to be async
* Reworked createWorker to be async and throw errors per #654
* Reworked createWorker to be async and throw errors per #654
* Edited detect to return null when detection fails rather than throwing error per #526
* Updated types per #606 and #580 (#663) (#664)
* Removed unused files
* Added savePDF option to recognize per #488; cleaned up code for linter
* Updated download-pdf example for node to use new savePDF option
* Added OutputFormats option/interface for setting output
* Allowed for Tesseract parameters to be set through recognition options per #665
* Updated docs
* Edited loadLanguage to no longer overwrite cache with data from cache per #666
* Added interface for setting 'init only' options per #613
* Wrapped caching in try block per #609
* Fixed unit tests
* Updated setImage to resolve memory leak per #678
* Added debug output option per #681
* Fixed bug with saving images per #588
* Updated examples
* Updated readme and Tesseract.js-core version
There are currently many issues related to how Tesseract.js handles errors within workers. For example, the issues below are all either directly about promises never resolving, or are more difficult to troubleshoot because promises never resolve (no error message in the main thread).
While we could implement smaller bug fixes for many of these, the larger issue appears to be that error messages are only reported from the worker threads to the main thread when caught and sent using
res.reject
. This means that any error that does not trigger ares.reject
call will not be reported.https://github.com/naptha/tesseract.js/blob/master/src/createWorker.js#L168-L174
Reworking to use the
worker.onerror
event would likely be more robust, and make it impossible for error messages to slip through the cracks in the future.The text was updated successfully, but these errors were encountered: