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

--turbo incompatible with core-js dom-collections #44169

Open
1 task done
zoobestik opened this issue Dec 19, 2022 · 1 comment
Open
1 task done

--turbo incompatible with core-js dom-collections #44169

zoobestik opened this issue Dec 19, 2022 · 1 comment
Labels
bug Issue was opened via the bug report template.

Comments

@zoobestik
Copy link

zoobestik commented Dec 19, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
  Node: 18.12.1
  npm: 8.19.2
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.8-canary.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

Turbopack (--turbo)

Link to the code that reproduces this issue

https://github.com/zoobestik/nextjs-turbo-corejs-bug

To Reproduce

Steps for repo:

Describe the Bug

Looks like currently --turbo incompatibale with some babel transpiled packages.
If in code presents web.dom-collections.iterator import (zloirock/core-js#1003) it raises exception:
Screenshot 2022-12-19 at 23 30 00

See stacktrace
_cc1f6a.js:63 Uncaught TypeError: Illegal invocation
    at Object.registerExportsForReactRefresh (_cc1f6a.js:63:40)
    at registerExportsAndSetupBoundaryForReactRefresh (_cc1f6a.js:50086:13)
    at runModuleExecutionHooks (_cc1f6a.js:50036:7)
    at instantiateModule (_cc1f6a.js:49991:5)
    at getOrInstantiateModuleFromParent (_cc1f6a.js:50073:12)
    at commonJsRequire (_cc1f6a.js:49816:12)
    at Object.<anonymous> (_cc1f6a.js:269:29)
    at [project-with-next]/node_modules/core-js/modules/web.dom-collections.iterator.js (ecmascript) (_cc1f6a.js:300:3)
    at _cc1f6a.js:49992:21
    at runModuleExecutionHooks (_cc1f6a.js:50031:5)

afterwards any client code doesn't worked.

Expected Behavior

There should be works with transpiled packages like before turbopack migration.

Which browser are you using? (if relevant)

Chrome 107.0.5304.87, Firefox 109.0b2, Safari 16.1

How are you deploying your application? (if relevant)

next dev --turbo

@zoobestik zoobestik added the bug Issue was opened via the bug report template. label Dec 19, 2022
@zoobestik
Copy link
Author

For reproduce also is possible just import in pages any of this files:

import 'core-js/modules/web.dom-collections.iterator.js';
// or
import "core-js/modules/web.dom-collections.for-each.js";

It happened in this script after access length prop of DOMTokenList instance. I think it's problem inside proxy getter, but i haven't got where. 😞

Chrome DevTools state before crash:
Screenshot 2022-12-19 at 23 40 46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant