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
Describe the bug
When building with TSC (with a very simple example pictured) there seems to be several missing types.
The built code does indeed work, but the errors in TSC are there nonetheless, so I'm making this bug report
I found this bug after some package updates on a repo I maintain, but after backtracking the issue was still there oddly. I'm not sure what changed since last week and this week, and (as shown in the image) was checking if it was @types/node, which it did not seem to be. (it could totally be something in the package lock, not sure. I didn't dive that deep)
To Reproduce
Steps to reproduce the behavior:
Install basic typescript dependencies and tesseract.js
Build any code that imports members of tesseract.js
TSC will report 7 errors.
Expected behavior
TSC should not report any errors
Device Version:
Arch Linux
Node v21.1.0
typescript@5.2.2
tesseract.js@5.0.3
@types/node@20.9.0
(reproduced on debian w/ node 20.5.1 as well)
Additional context
N/A
The text was updated successfully, but these errors were encountered:
A minimal Typescript example with Tesseract.js can be found here. Tesseract.js supports both browsers and Node.js, with only slight differences between the versions. The types file includes types from both. It looks like the issue here is that you are building a project for Node.js, and the compiler is throwing an error for all of the types that only exist for browsers.
Based on my very limited understanding of Typescript, I believe that this is probably an issue with the project/build configuration, and that the tsconfig.json can be modified such that it does not throw errors for types that exist in browsers. However, let me know if you investigate further and find this is not the case, and that some change is required in this repo, and we can discuss further.
I've found that you are correct, this is an issue of browser only code being in an environment I had setup not to support that.
in my tsconfig.json I had
Tesseract.js version 5.0.3
Describe the bug
When building with TSC (with a very simple example pictured) there seems to be several missing types.
The built code does indeed work, but the errors in TSC are there nonetheless, so I'm making this bug report
I found this bug after some package updates on a repo I maintain, but after backtracking the issue was still there oddly. I'm not sure what changed since last week and this week, and (as shown in the image) was checking if it was @types/node, which it did not seem to be. (it could totally be something in the package lock, not sure. I didn't dive that deep)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
TSC should not report any errors
Device Version:
(reproduced on debian w/ node 20.5.1 as well)
Additional context
N/A
The text was updated successfully, but these errors were encountered: