'ReferenceError: BigInt is not defined' due to the BigInt in v5.35.1 or newer version
See original GitHub issueBug report
What is the current behavior?
After we upgrade the version of webpack to be v5.35.1 or newer, we will get below errors. If the version is older than v5.35.0, it would be OK. In fact, I already find the cause in the commit history. This issue is caused by this PR https://github.com/webpack/webpack/pull/13213 with this commit https://github.com/webpack/webpack/commit/acfea9dae42fb1182b4e162b7f0d752129a3bd34 by @sokra . In this commit, it’s using BigInt which brings this issue.
Resolve error: ReferenceError: BigInt is not defined
at Object.<anonymous> (xxx/node_modules/webpack/lib/ChunkGraph.js:42:22)
at Object.<anonymous> (xxx/node_modules/webpack/lib/ChunkGraph.js:1672:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (xxx/node_modules/webpack/lib/Chunk.js:8:20)
If the current behavior is a bug, please provide the steps to reproduce. Just need to update the version and check build log.
What is the expected behavior? There should no such errors “Resolve error: ReferenceError: BigInt is not defined”
Other relevant information: webpack version: v5.35.1 or newer Node.js version: v12.15.0 Operating System: Mac v11.3.1 Additional tools: VS Code v1.33.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
@alexander-akait thanks for your help.
node file.js
works with node v14.16.1.I finally got the cause. it’s due to the editor VSCode version. I just upgraded it from v1.33.1 to be v1.56.2 and it’s ok now.
thanks again!
Something wrong with Node.js in your dev env