-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
7.13 "_interopRequireDefault is not a function" #12854
Comments
Hey @KyleAMathews! 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." |
Niiice we have a ton of tests in theory for this. |
well that's strange... https://unpkg.com/@babel/runtime@7.13.0/helpers/interopRequireDefault/index.js Lemme look again |
Think we tried to change to a folder in a backwards compatible way https://unpkg.com/browse/@babel/runtime@7.12.18/helpers/interopRequireDefault.js vs |
This is the same as #12853 |
@KyleAMathews I know it's probably easy to reproduce this, but do you have a project which already shows the error I can start from? 😅 |
@nicolo-ribaudo use the gatsby default again but with the fix in #12852 applied but run |
Ok thanks 😂 |
@nicolo-ribaudo you can use this repo! https://github.com/gillkyle/babel-repro It's got even less packages than the default starter if you're looking for something you can just clone. I'm getting this error locally when running gatsby build:
EDIT: realizing now how useless that output is (besides file paths) 😅 |
yeah, we kill internal stack traces which isn't so helpful when that's where they're happening. |
I know the problem and the fix, working on the PR. Babel injects this code: var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Webpack sees this exports map And replaces it with (because that's what we are telling it to do) var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault/index.mjs"); |
This issue is not reproducible on Webpack 5, which supports exports map. For Webpack 4, a workaround is to configure ['.wasm', '.js', '.mjs', '.json'] So webpack will resolve |
This bug is NOT fixed (as evidenced by the many new issues being opened within the last few hours). It would appear that a LOT of dependencies are pulling in the latest versions of babel automatically which makes it difficult to even temporarily roll back to an earlier babel version (unless you commit a yarn.lock file). Don't mean to complain--just trying to get the word out that there are still some serious issues unresolved. |
I HAVE MET THIS PROBLEM TOO, SOMEBODY HELP ME PLEASE |
Could you two share your lockfiles please? 🙏 |
@nicolo-ribaudo EDIT: It works with "@babel/runtime": "7.12.18" and does not work with either "7.13.0" or "7.13.1" or "7.13.2" |
_interopRequireDefault is not a function this bug is not solved @nicolo-ribaudo could you fixed it as soon as possible? |
Yes, I'll start working on this in 10 mins |
Are you ok? I am error now |
@wangcherry Could you upload your lockfile? 🙏 |
I haven't tested any new developments yet since early this morning (EST). |
Ok, it looks like at least my particular issue is resolved with the latest babel release. After doing a clean install (wiping node_modules and the lock file) everything seems to be working again. |
Hopefully this isn't gibberish from my end. I've tried running a clean build my React app with these settings: "dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
},
"devDependencies": {
"@babel/core": "^7.13.1",
"@babel/plugin-transform-runtime": "^7.13.6",
"@babel/preset-env": "^7.13.5",
"@babel/preset-react": "^7.12.13",
"webpack": "^5.4.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.4.0",
} Also tried running @babel with version @7.12, but I got the same error in the browser. |
Can you share your lockfile? |
Sorry to bother! I got it fixed, but I had to install @nicolo-ribaudo Let me know if you still need to see my Lockfile. |
Oh I think that the reason was that one of your dependency was using |
Hi! |
Babel/runtime might cause a bug when using Webpack 4 and Jest, see babel/babel#12854
7.13.10 should be working. |
We need at least Babel 7.13.10 because of babel/babel#12854 TEST PLAN: run test, run doc app, run SIStemic tests via Verdaccio
We need at least Babel 7.13.10 because of babel/babel#12854 TEST PLAN: run test, run doc app, run SIStemic tests via Verdaccio
In addition to #12851
If you set
resolutions
for@babel/core
to~7.12.0
you then get this error:gatsby-link
requiresbabel/runtime/helpers/interopRequireDefault
which seems to no longer exist in@babel/runtime@7.13
The text was updated successfully, but these errors were encountered: