Skip to content

Rename index.mjs to _index.mjs in @babel/runtime#12855

Merged
nicolo-ribaudo merged 2 commits intobabel:mainfrom
nicolo-ribaudo:regression-7.13.0-2
Feb 23, 2021
Merged

Rename index.mjs to _index.mjs in @babel/runtime#12855
nicolo-ribaudo merged 2 commits intobabel:mainfrom
nicolo-ribaudo:regression-7.13.0-2

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 23, 2021

Q                       A
Fixed Issues? fix #12854, fix #12853
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This should fix #12854, but for some reason webpack still loads the .mjs version when using require() 🤔
Maybe it's a caching problem, but what I see locally is that even uses the .mjs version even if I remove every mention of .mjs in @babel/runtime's package.json

The problem is that Webpack 4 always loads index.mjs if there are both index.js and index.mjs, and there is no way (unless you update the webpack config) to tell it to load index.js.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Feb 23, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 00b6291:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo nicolo-ribaudo changed the title Add require condition to @babel/runtime Rename index.mjs to _index.mjs in `@babel/runtime Feb 23, 2021
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I can confirm that this works in my local gatsby project.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Feb 23, 2021
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review February 23, 2021 00:58
@nicolo-ribaudo nicolo-ribaudo changed the title Rename index.mjs to _index.mjs in `@babel/runtime Rename index.mjs to _index.mjs in @babel/runtime Feb 23, 2021
@KyleAMathews
Copy link
Copy Markdown

Thanks 🙏

@nicolo-ribaudo nicolo-ribaudo merged commit 0c65ff7 into babel:main Feb 23, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the regression-7.13.0-2 branch February 23, 2021 01:08
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

@babel-bot
Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/41949/

@KyleAMathews
Copy link
Copy Markdown

@nicolo-ribaudo thanks so much! Confirmed Gatsby is back in business with 7.13.1 🎉

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I'm going to sleep now, but tomorrow I'll DM you to see how we can add Gatsby as an e2e test 😬

@KyleAMathews
Copy link
Copy Markdown

Excellent!

@DSchau
Copy link
Copy Markdown

DSchau commented Feb 23, 2021

@nicolo-ribaudo thank you truly for the quick turnaround on this.

We at Gatsby appreciate this, and so too do our users. We'd love to chat about e2e test, so let us know how we can help ensure we can automate and track this case for the future 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7.13 "_interopRequireDefault is not a function" Error with latest @babel/helper-create-class-features-plugin (v7.13.0)

6 participants