Skip to content
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

Node.js v18 & v19 don't support some es2023 features #217

Open
mdashlw opened this issue Aug 28, 2023 · 3 comments · May be fixed by #277
Open

Node.js v18 & v19 don't support some es2023 features #217

mdashlw opened this issue Aug 28, 2023 · 3 comments · May be fixed by #277

Comments

@mdashlw
Copy link

mdashlw commented Aug 28, 2023

ES2023 introduced toSorted, toReversed, toSpliced , with, and findLast and findLastIndex methods on Array.prototype,
Node.js 18 and 19 only support findLast and findLastIndex, and don't support toSorted and others

node18 and node19 bases both specify es2023 lib
https://github.com/tsconfig/bases/blob/5ee68ffc8325546335649525a3553067d2d27830/bases/node18.json
https://github.com/tsconfig/bases/blob/5ee68ffc8325546335649525a3553067d2d27830/bases/node19.json

I suspect nothing can be really done about this?

@orta
Copy link
Member

orta commented Aug 28, 2023

At this repo no, but those will probably come (or be fixed in) a new TypeScript release I expect

@alexeyr-ci
Copy link

Filed microsoft/TypeScript#56796.

@alexeyr-ci
Copy link

alexeyr-ci commented Dec 15, 2023

Maybe https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#supporting-lib-from-node_modules can work to override es2023 (or just es2023.array if possible)?

something-predictable pushed a commit to something-predictable/node-env that referenced this issue Apr 20, 2024
as they sadly does not err on the side of caution, cf. tsconfig/bases#217.
@zanminkian zanminkian linked a pull request Oct 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants