webpack: Fails to parse BigInteger Literal
Bug report
What is the current behavior?
const bigInteger = 0n;
Causes the following error:
Module parse failed: Identifier directly after number (0:20)
You may need an appropriate loader to handle this file type.
Compiling from typescript to esnext
.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
const bigInteger = 0n;
A script with the above contents should be parsed and emitted without error.
Other relevant information: webpack version: 4.30.0 Node.js version: 8.11.3 Operating System: Windows 10 Additional tools: typescript, awesome-typescript-loader
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (6 by maintainers)
Commits related to this issue
- Avoid bigint literals Since webpack doesn't support it (yet) https://github.com/webpack/webpack/issues/9077 — committed to flaktack/bigint-money by flaktack 5 years ago
@evilebottnawi gotcha. Here’s a repro https://github.com/chrisui/bigint-literal-webpack-issue
@azizj1 I didn’t find any last month, I ended up changing the code to use
BigInt(1)
instead of1n
Sometimes proposals on stage 3 were declined, so i don’t think it is good idea support this out of box