TypeScript compiler cannot find name 'BigInt'
See original GitHub issueThe BigInt type in the Stats.d.ts
file causes TypeScript to throw a 2304 (cannot find name) error, so the compilation fails.
TypeScript 2.8.3 memfs 2.14.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Using BigInt in TypeScript - Stack Overflow
ts:1:9 - error TS2304: Cannot find name 'BigInt'. 1 let x = BigInt(123) ~~~~~~ Found 1 error.
Read more >Unable to run ionic old project: Cannot find name 'bigint'
I am trying to run my old project to modification, I have successfully run npm install but unable to serve the app. It's...
Read more >Microsoft/TypeScript - Gitter
I believe I should be able to use BigInt now in TypeScript...but changing some code base to use and I get "Cannot find...
Read more >Documentation - TypeScript 3.2
TypeScript 3.2 introduces a new strictBindCallApply compiler option (in the ... You can get a bigint by calling the BigInt() function or by...
Read more >Unable to use BigInt in typescript version 3.4.5. Error TS2304 ...
[Solved]-Unable to use BigInt in typescript version 3.4.5. Error TS2304: Cannot find name 'BigInt'-angular.js ... I am able to resolve the error by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@streamich @pizzafroide Thanks for your responses. I tried out both suggestions and ended up opting to just upgrade TypeScript. C’est la vie.
You are right:
BigInt
support was added to TypeScript 3.2, and, unfortunately, they say:However,
BigInt
support was added tomemfs
before it was inTypeScript
. To make it work, we needed to addBigInt
definition ourselves (inbigint.d.ts
file). This file is still there. Maybe it could be copied tolib
directory at compile time so “old TypeScript” users could import it. @mjfreem1, in the meantime, you can add the following code in some file and import it before importingmemfs
: