question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'ReferenceError: BigInt is not defined' due to the BigInt in v5.35.1 or newer version

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lukewang2018commented, May 20, 2021

@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.

Screen Shot 2021-05-20 at 11 22 10 PM

thanks again!

0reactions
alexander-akaitcommented, May 20, 2021

Something wrong with Node.js in your dev env

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: BigInt is not defined Asar Electron Nodejs
This error sounds like you don't have a new enough nodejs version as BigInt was added in v10.4 and the error is coming...
Read more >
ReferenceError: BigInt is not defined - panva/jose - GitHub
I am using nvm for node versions, can that be an issue? It may not be set up right, run node -v for...
Read more >
ESLint — How to Fix “BigInt is not defined” - Future Studio
ESLint showed an issue that “BigInt is not defined” while mapping the primary key values from the database to BigInt values in JavaScript....
Read more >
ReferenceError: BigInt is not defined : r/node - Reddit
I have downloaded an npm package which uses BigInt inside it and I get following error : ReferenceError: BigInt is not defined.
Read more >
Issue creating backend application using local DB - Help me!
Actual behavior. When I run the Lumber generate command I'm getting the following error: ReferenceError: BigInt is not defined ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found