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

[Bug]: Uncaught SyntaxError: The requested module '/node_modules/@babel/runtime/regenerator/index.js?v=8bc5bdce' does not provide an export named 'default' #13498

Closed
1 task
JesusTheHun opened this issue Jun 22, 2021 · 6 comments
Labels
i: invalid outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@JesusTheHun
Copy link

💻

  • Would you like to work on a fix?

How are you using Babel?

Other (Next.js, Gatsby, vue-cli, ...)

Input code

Using esbuild and @testing-library/dom I run into this error :

Uncaught SyntaxError: The requested module '/node_modules/@babel/runtime/regenerator/index.js?v=8bc5bdce' does not provide an export named 'default'

Because @testing-library/dom uses `import _regeneratorRuntime from '/node_modules/@babel/runtime/regenerator/index.js';

Sadly this file https://github.com/babel/babel/blob/main/packages/babel-runtime/regenerator/index.js lacks of the default export.

Configuration file name

No response

Configuration

No response

Current and expected behavior

https://github.com/babel/babel/blob/main/packages/babel-runtime/regenerator/index.js should have the default export.

Environment

@babel/runtime@7.14.6

System: OS: macOS 11.4 Binaries: Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node Yarn: 2.4.1 - /usr/local/bin/yarn npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm npmPackages: @babel/core: ^7.14.6 => 7.14.6 @babel/eslint-parser: ^7.14.5 => 7.14.5 babel-loader: ^8.2.2 => 8.2.2 eslint: ^7.5.0 => 7.28.0 jest: ^27.0.4 => 27.0.4

Possible solution

Add the default export

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @JesusTheHun! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@nicolo-ribaudo
Copy link
Member

regenerator-runtime only provides a CJS entry point. You need to configure your bundler to support CJS files, or you cannot transform generators to ES5.

@nrgnrg
Copy link

nrgnrg commented Nov 10, 2021

I'm also using esbuild and @testing-library/react and am getting this error

@nicolo-ribaudo
Copy link
Member

You need to configure esbuild to be able to import commonjs files.

@FuShanChuan
Copy link

Would like to ask how the final solution?

@nicolo-ribaudo
Copy link
Member

This is an esbuild configuration problem; it's unlikely that someone in this repository can help 😅

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 31, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: invalid outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants