-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommended tsconfig.json target option for Node 14 is ES2020 which is not fully supported by Node 14. #46325
Comments
confirmed. I wonder if this was essentially a bug which was discovered and fixed later in V8 and made it only into node v16+. 🤔 |
seems like it: https://bugs.chromium.org/p/v8/issues/detail?id=11558 compat-table/compat-table#1708 that said, I think |
Not surprised it turned out to be a bug - the error message mentions |
Yeah, even knowing this I think es2020 is a safe enough call vs recommending es2019 👍🏻 - thanks for the pointer. We could add a note to the wiki page though? |
I've gone and updated https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping to mention this issue and suggest lowering target to ES2019 if this feature is needed. With the EOL of Node 14 and the immanent EOL of Node 16 (which was only affected in <16.3.0, which nobody should be using), I think that people are very unlikely to hit this. (TS itself targets ES2020 despite officially supporting Node 14!) |
Bug Report
🔎 Search Terms
node 14, tsconfig.json, es2020, recommended
Problem
According to the Node Target Mapping wiki page the recommended
tsconfig.json
for Node 14 is:However, if we look at the node.green ES2020 feature support table we will see that Node 14 does not support one feature of ES2020 which is "spread parameters after optional chaining".
⏯ Playground Link
Playground link with relevant code
💻 Code
input.ts
:Output JavaScript:
🙁 Actual behavior
🙂 Expected behavior
true
The text was updated successfully, but these errors were encountered: