Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

329
Views
Cant use BigInt in TS project regardless of es2020

I have simple TS project where this is my tsconfig.json

{
  "compilerOptions": {
    "target": "es2020",
    "lib": ["es2020"],
  }
}

And I have one file, script.ts with following code inside

BigInt(2);

Unfortunatelly, when I execute tsc script.ts, I receive this error: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later.

Why is that happening? Isn't my library set to correct version?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

BigInt is relativele new feature in Typescript, So in order to use it you have to specify target: esnext in your tsconfig.json

In your code you can create BigInt with n suffix, like this:

const bigIntNumber = 1n
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!