-
Notifications
You must be signed in to change notification settings - Fork 12.8k
error TS2318: Cannot find global type 'BigInt' #49101
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
Comments
That's a necessary evil afaik because all the later targets reference |
@RyanCavanaugh 4.7.1, 4.7.2, or 4.8.0? |
4.7.2 |
I think there's an error when the target is less than es2020 too, but errors resolving This happens in |
Broken by #33767 |
I'm not sure what the right long-term fix is, but the short-term fix is to remove |
The current behaviour for Some better fixes:
(1) is probably separate from (2-4). I don't know what should be allowed here -- for example, as long as the emit for es2020 doesn't rely on es2015 stdlib declarations, it should be fine to have target=es2020 and lib=es5. |
Bug Report
The provided code fails with compiler error:
error TS2318: Cannot find global type 'BigInt'.
without any location information.🔎 Search Terms
BigInt, Object.freeze
🕗 Version & Regression Information
This changed between versions 4.6.4 and 4.7-beta
⏯ Playground Link
No playground reproduce for this bug as it's not possible to set target and lib differently from the playground.
Steps to reproduce
Note :
./node_modules/.bin/tsc --target es2020 --lib es2020 index.ts
does not print an error.💻 Code
🙁 Actual behavior
TypeScript compiler prints
error TS2318: Cannot find global type 'BigInt'.
without any source location.🙂 Expected behavior
I'm not sure what the actual behavior here needs to be, but at least the new additioal type definition of
Object.freeze
in lib.es5.d.ts start to trigger this failure.I think the
lib.es5.d.ts
should not contain type definition that usesbigint
Please let me know if this should go to https://github.com/microsoft/TypeScript-DOM-lib-generator/issues instead.
The text was updated successfully, but these errors were encountered: