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.

"'BigInt' is not defined" for build-in BigInt

See original GitHub issue

My environment

  • ESLint Version: 5.15.2 (I just updated from 4.19.1 when I was attempting to void the issue)
  • Node Version: v10.15.1
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using? standard

Please show your full configuration: I’m using standardjs

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

let totalPrice = BigInt(0)
totalPrice += BigInt(123)
f (BigInt(totalPrice) === BigInt(0)) console.log('PAID')
standard --fix

What did you expect to happen? BigInt should be recognized as build-in object and there should not be “no-undef” error.

What actually happened? Please include the actual, raw output from ESLint. “‘BigInt’ is not defined.” error is thrown.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
vanduc1102commented, May 19, 2019

i added

'globals':{
    'BigInt':true
  },

to eslint config

5reactions
not-an-aardvarkcommented, Mar 18, 2019

To enable the BigInt global you can add a comment to your code:

/* global BigInt */

To avoid needing to do this, you could ask the standard maintainers to enable BigInt in their configuration.

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 >
BigInt not defined after changing eslist config env variables
BigInt not defined after changing eslist config env variables · 1)Added the following according to tutorial in hello_frontend/package.json file
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 >
BigInt - JavaScript - MDN Web Docs
BigInt values are similar to Number values in some ways, but also differ in a few key matters: A BigInt value cannot be...
Read more >
big-integer - npm
If you are using node, you can install BigInteger with npm. npm install big-integer. Then you can include it in your code: var...
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