Module not found: Error: Can't resolve '@babel/runtime/helpers/createSuper'
See original GitHub issueBug Report
- I would like to work on a fix!
Current Behavior
After re-installing my Macbook, the error Module not found: Error: Can't resolve '@babel/runtime/helpers/createSuper'
is occuring during webpack bundling.
Input Code
Expected behavior/code Can be bundled without error.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
- Filename:
package.json
in root.
{
"name": "...",
"description": "...",
"repository": {
"type": "git",
"url": "..."
},
"engines": {
"node": ">=6.9.0",
"npm": ">=3.0.0"
},
"version": "0.1.0",
"scripts": {
"bootstrap": "cross-env NODE_ENV=test NODE_OPTIONS=--max_old_space_size=4096 lerna bootstrap --hoist --nohoist=SOMETHING-* --no-ci",
},
"lint-staged": {
"linters": {
"packages/**/*.{js,jsx}": [
"eslint --fix",
"git add"
]
},
"ignore": []
},
"dependencies": {
"@babel/runtime": "7.0.0",
"@sentry/cli": "1.46.0",
"convert-css-color-name-to-hex": "0.1.1",
"history": "4.7.2",
"mobx-utils": "5.1.0",
"mutationobserver-shim": "0.3.2",
"nyc": "^15.0.0",
"qs": "6.7.0",
"react-delayed": "0.2.3",
"react-transition-group": "2.4.0",
"ua-parser-js": "0.7.19"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/parser": "7.7.5",
"@babel/plugin-proposal-class-properties": "7.0.0",
"@babel/plugin-proposal-decorators": "7.0.0",
"@babel/plugin-proposal-object-rest-spread": "7.0.0",
"@babel/plugin-proposal-optional-chaining": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.0.0",
"@babel/plugin-transform-runtime": "7.0.0",
"@babel/polyfill": "7.0.0",
"@babel/preset-env": "7.0.0",
"@babel/preset-react": "7.0.0",
"@sentry/browser": "5.6.3",
"@sentry/webpack-plugin": "1.7.0",
"babel-eslint": "9.0.0",
"babel-loader": "8.0.0",
"babel-plugin-istanbul": "5.0.1",
"babel-preset-es2015-mod": "6.6.0",
"cache-loader": "1.2.2",
"chai": "4.1.2",
"circular-dependency-plugin": "4.3.0",
"copy-webpack-plugin": "4.5.2",
"cross-env": "3.2.4",
"emoji-regex": "7.0.1",
"eslint": "5.5.0",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.1",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"find-imports": "0.5.2",
"gh-pages": "2.0.1",
"husky": "0.14.3",
"istanbul-instrumenter-loader": "3.0.1",
"karma": "4.0.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.2",
"karma-coverage-istanbul-reporter": "2.0.5",
"karma-junit-reporter": "1.2.0",
"karma-mocha": "1.3.0",
"karma-mocha-reporter": "2.2.5",
"karma-requirejs": "1.1.0",
"karma-scss-preprocessor": "4.0.0",
"karma-sourcemap-loader": "0.3.7",
"karma-stacktrace": "1.0.3",
"karma-webpack": "4.0.0-rc.2",
"karma-webpack-grep": "1.0.1",
"lerna": "3.13.1",
"lint-staged": "7.1.2",
"lodash-es": "4.17.5",
"mocha": "6.0.2",
"node-glob": "1.2.0",
"node-sass": "4.12.0",
"promise-polyfill": "7.0.0",
"react-autosize-textarea": "4.0.0",
"react-focus-lock": "1.19.1",
"requirejs": "2.3.5",
"sass-lint": "1.11.1",
"sinon": "7.3.2",
"slash": "1.0.0",
"thread-loader": "1.2.0",
"webpack": "4.17.2"
},
"private": true
}
- Filename:
webpack.config.js
{
test: /\.jsx?$/,
use: [
"thread-loader",
"cache-loader",
{
loader: "babel-loader",
options: {
presets: [
[
"@babel/preset-env",
{
modules: false,
loose: true,
debug: false,
useBuiltIns: false,
targets: {
browsers: ["ie >= 10"]
}
}
],
"@babel/preset-react"
],
plugins: [
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-class-properties", { loose: true }],
["@babel/plugin-proposal-optional-chaining", { loose: true }],
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import",
"react-hot-loader/babel"
]
}
}
],
exclude: /node_modules/
},
Environment
System:
OS: macOS 10.15.3
Binaries:
Node: 12.16.1 - /usr/local/bin/node
npm: 6.13.4 - /usr/local/bin/npm
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Monorepo: Lerna
- How you are using Babel: loader
Possible Solution
Additional context/Screenshots
I’ve removed the node_modules
and re-installed it, but it is occurring as before.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Module not found: Can't resolve @babel/runtime/helpers
To solve the error "Module not found: Error: Can't resolve '@babel/runtime/helpers'", make sure to install the @babel/runtime package by opening your terminal ...
Read more >How to fix - Module not found: Can't resolve '@babel/runtime ...
You can install @babel/runtime to fix the problem: Using npm: npm install --save @babel/runtime. Using yarn: yarn add @babel/runtime.
Read more >@babel/runtime - npm
babel's modular runtime helpers. Latest version: 7.20.7, ... Start using @babel/runtime in your project by running `npm i @babel/runtime`.
Read more >Cannot find module 'babel-runtime/helpers/asyncToGenerator'
Module not found : Can't resolve @babel/runtime/helpers ... Open your terminal in your project's root directory (where your package.json file is located) and...
Read more >babel/runtime
babel /runtime` is a library that contains Babel modular runtime helpers. ... This is meant to be used as a runtime dependency along...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ygnoh I found the problem: it was a bug fixed in
@babel/core
7.5.5 (https://github.com/babel/babel/pull/10208)As a general rule, we recommend using
^
for your Babel-related version so that you automatically get bugfixes.Hi @ygnoh! We have some logic specifically to avoid injecting helpers imports when they are not supported by the
@babel/runtime
version, and so far it has always been working: I don’t understand where is the bug now. Would you be able to provide a small repository that reproduces the issue?As a workaround, you can update
@babel/runtime
to^7.9.0
.