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

would you be open to updating core-js to latest ^3 version to get support for es2024 (node20) and further? #1246

Open
iamstarkov opened this issue Jan 27, 2025 · 3 comments

Comments

@iamstarkov
Copy link

iamstarkov commented Jan 27, 2025

Set.difference was added in es2024, core-js got support for it in 3.0.0. Support for it was added in nodejs 22, Github Actions still run nodejs 20.

TypeError: Set.difference is not a function or its return value is not iterable

when running code with Set.difference on node20 while using default es2015 target while using latest ncc.

Its because ncc has core-js stuck at ^2.5.7 and latest core-js dependabot pr was closed over 3 years ago

I'd like to avoid manually embedding polyfills import "core-js/stable/set"; like 10 years ago before the times of @babel/preset-env which is powered by browserslist and core-js.

I understand you maybe busy with other projects, but would you be open to updating core-js to keep ncc relevant with latest ecmascript and nodejs releases? if you were, but have no time, let me know and I'll try do it myself

@styfle
Copy link
Member

styfle commented Jan 28, 2025

Pretty sure core-js is only used to test that core-js could be bundled here:

require("core-js").Array.map([], () => {});

Upgrading that devDependency won't change the behavior of ncc.

That said, if you want to update it and confirm the test passes, feel free to do so.

@iamstarkov
Copy link
Author

huh, I assumed lack of Set polyfills stemmed from old core-js version in use, but if its not true, than it must have another source? Would you know which direction to start looking? is webpack the next best guess?

@styfle
Copy link
Member

styfle commented Jan 29, 2025

Yeah sounds like webpack is just outdated since it was before Set.difference existed.

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

No branches or pull requests

2 participants