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

core-js >=3.12 throws errors Target is not iterable #5943

Closed
3 tasks done
satanTime opened this issue Jul 4, 2021 · 19 comments
Closed
3 tasks done

core-js >=3.12 throws errors Target is not iterable #5943

satanTime opened this issue Jul 4, 2021 · 19 comments
Labels
🐛 Bug 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler

Comments

@satanTime
Copy link

satanTime commented Jul 4, 2021

🐛 bug report

Preflight Checklist

  • I have read the [Contributing Guidelines][contributing] for this project.
  • I agree to follow the [Code of Conduct][code_of_conduct] that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

Local usage of core-js >= 3.12 doesn't have issues, whereas codesandbox throws Target is not iterable.

How has this issue affected you? What are you trying to accomplish?

I try to keep dependencies up to date.

To Reproduce

  • change in dependencies the version of core-js to 3.11.3
  • click refresh in the builtin browser
  • wait when the app has been rendered
  • change in dependencies the version of core-js to 3.12.0
  • click refresh in the builtin browser
  • the error appears

if you download the project and run it locally, it works correctly.

@rocifier
Copy link

rocifier commented Jul 7, 2021

Maybe this is a combination of package versions because every version of core-js I try is broken with that error

@rocifier
Copy link

rocifier commented Jul 7, 2021

Nevermind, I wasn't hitting refresh every time. Confirmed it is broken since 3.12.0

@NickMitrokhin
Copy link

Hi, Any news?

@satanTime
Copy link
Author

Hi @smhutch,

I hope this finds you well.

Could you provide a brief update on this issue?

@zloirock
Copy link

zloirock commented Sep 4, 2021

From this version, core-js does not accept not pretty correct third-party Symbol polyfills that break core-js, so it's a conflict with another polyfill.

@satanTime
Copy link
Author

satanTime commented Sep 4, 2021

The thing which confuses me is that it actually works locally with the same setup, or on stackblitz. The only place where I see this error is codesandbox.

@lbogdan lbogdan added the 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler label Sep 6, 2021
@lbogdan
Copy link
Contributor

lbogdan commented Sep 6, 2021

@DeMoorJasper can you please take a look at this?

@DeMoorJasper
Copy link
Member

Seems to work fine to me, can somebody create a reproduction?

@babich-a
Copy link

babich-a commented Sep 6, 2021

@DeMoorJasper https://codesandbox.io/s/jovial-hawking-lx4oy (just change "core-js": "3.12.0", in package.json from angular template as in the first post said)

@satanTime
Copy link
Author

@DeMoorJasper, I would assume you forgot to refresh the builtin browser manually.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Sep 6, 2021

@babich-a Thank you I can reproduce it now, will look into (and hopefully fix) it tomorrow

@satanTime
Copy link
Author

Hi @DeMoorJasper,

could you provide an update on the issue?

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Sep 14, 2021

@satanTime looking into it today, something came up preventing me from looking into this sooner.

Found the issue, it's due to core-js relying on process.versions.v8 to detect if the environment has native Symbol support which is not really an option in the browser, but when using nodeJS polyfills (like we do) it is set to 0.0. So this is a bug in core-js cc @zloirock

I'll change the process polyfill (https://github.com/jvilk/bfs-process/blob/master/ts/process.ts) to work around this... the ideal solution would be that core-js doesn't rely on nodeJS globals if it's in a browser environment...

Hacked around it and opened a PR, will put it in production once the tests pass

@satanTime
Copy link
Author

Hi @zloirock should we create an issue in core-js repo regarding what @DeMoorJasper is proposing?

the ideal solution would be that core-js doesn't rely on nodeJS globals if it's in a browser environment...

@zloirock
Copy link

zloirock commented Oct 17, 2021

@satanTime the problem is that NodeJS also could emulate browser environment. We couldn't just stop check the V8 version in feature detection because it will cause a critical slowdown (100x+) in some cases even if nothing is polyfilled because of V8 whims like this. I'll try to add a workaround, but mainly it should be fixed on NodeJS polyfills side - it's their bug - .v8 should not be '0.0' anyway - if you don't know the engine version - just miss it instead of reporting the incorrect result.

@babich-a
Copy link

It seems core-js@3.19.1 has a fix for this problem. @zloirock can you confirm?

@zloirock
Copy link

Yes, I added a workaround for this bfs-process bug.

@DeMoorJasper
Copy link
Member

Thank you for fixing this @zloirock 🙏 will close this issue

@zloirock
Copy link

@DeMoorJasper it could be better to specify the actual core-js version in dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants