[extract] Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
See original GitHub issueDescribe the bug
After upgrading to babel@7, lingui extract
fails with this error.
/PROJECT_PATH/node_modules/@babel/helper-plugin-utils/lib/index.js:72
throw Object.assign(err, {
^
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
at throwVersionError (/PROJECT_PATH/node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/PROJECT_PATH/node_modules/@babel/helper-plugin-utils/lib/index.js:13:11)
at api (/PROJECT_PATH/node_modules/@babel/plugin-syntax-dynamic-import/lib/index.js:19:7)
at /PROJECT_PATH/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at Function.memoisePluginContainer (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
at Function.normalisePlugin (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
at /PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/PROJECT_PATH/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/PROJECT_PATH/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transformFileSync (/PROJECT_PATH/node_modules/babel-core/lib/api/node.js:152:10)
at Object.extract (/PROJECT_PATH/node_modules/@lingui/cli/api/extractors/babel.js:52:38)
at /PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:90:11
at Array.some (<anonymous>)
at /PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:84:56
at Array.forEach (<anonymous>)
at extract (/PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:72:12)
at /PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:80:7
at Array.forEach (<anonymous>)
at extract (/PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:72:12)
at /PROJECT_PATH/node_modules/@lingui/cli/api/extract.js:80:7
To Reproduce Steps to reproduce the behavior, possibly with minimal code sample, e.g:
- Upgrade to babel@7
- Run
lingui extract
Expected behavior Tokens extracted (duh), or provide a little more help in identifying which package is causing the old babel version to be loaded maybe?
Additional context Add any other context about the problem here.
- jsLingui version
lingui --version
: 2.7.0 - Babel version
npm list babel-core
: 6.26.3 - Your Babel config (e.g.
.babelrc
) or framework you use (Create React App, Meteor, etc.)
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
">1%",
"not ie 10",
"ie 11",
"not op_mini all"
]
}
}
],
"@babel/preset-react",
"@lingui/babel-preset-react"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"react-hot-loader/babel"
],
"env": {
"test": {
"plugins": [
"dynamic-import-node"
]
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Requires Babel "7.0.0-0" but was loaded with "6.26.3"
Test which version you are running with cmd babel -V. If it is not verion 7 or higher npm uninstall babel-cli -g npm...
Read more >Requires Babel “7.0.0-0” but was loaded with “6.26.3” - GitHub
In a test setup.js file, I was importing babel-register instead of @babel/register . If you feel like your dependencies are updated, ...
Read more >Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
I'm facing the below build issue. Some of dependencies has babel 6 and some has babel 7. But, when a dependency requires babel...
Read more >babel-loader > JavaScript for PHP Geeks - SymfonyCasts
It says: require this module and then pass it through babel-loader . You can even have multiple loaders, each separated by an exclamation...
Read more >Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3"
an old version of Babel. 3. . 4. One way around if Babel6 is required by the dependency: 5. $ npm install babel-core@^7.0.0-bridge...
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
I apologize if that sounded catty – by “quietly”, I only meant that the “getting started” routine had changed since I got started. I just needed to RTFM. 🤣
The situation is far from annoying - doing all this i18n work without lingui would be annoying. Thank you for this amazing tool!
Hey @alampros, you indeed have babel-core@6:
What’s the full output or
yarn why babel-core
ornpm list babel-core
?