Babel error at `yarn start`
HirenPatel2791 opened this issue · comments
Issue
$ babel-node tools/run start
/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:135
throw e;
^
Error: [BABEL] /HOME/react-dashboard-try/tools/run.js:
Error: [BABEL] /HOME/react-dashboard-try/tools/run.js:
As of v7.0.0-beta.55, we've removed Babel's Stage presets.
Please consider reading our blog post on this decision at
https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
for more details. TL;DR is that it's more beneficial in the
long run to explicitly add which proposals to use.
For a more automatic migration, we have updated babel-upgrade,
https://github.com/babel/babel-upgrade to do this for you with
"npx babel-upgrade".If you want the same configuration as before:
{
"plugins": [
// Stage 2
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings"
]
}
If you're using the same configuration across many separate projects,
keep in mind that you can also create your own custom presets with
whichever plugins and presets you're looking to use.
module.exports = function() {
return {
plugins: [
require("@babel/plugin-syntax-dynamic-import"),
[require("@babel/plugin-proposal-decorators"), { "legacy": true }],
[require("@babel/plugin-proposal-class-properties"), { "loose": false }],
],
presets: [
// ...
],
};
};
(While processing: "/HOME/react-dashboard-try/node_modules/@babel/preset-stage-2/lib/index.js")
at _default (/HOME/react-dashboard-try/node_modules/@babel/preset-stage-2/lib/index.js:9:9)
at loadDescriptor (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:74:38)
at loadFullConfig (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/full.js:108:6)
at loadOptions (/HOME/react-dashboard-try/node_modules/@babel/core/lib/config/index.js:27:36)
at OptionManager.init (/HOME/react-dashboard-try/node_modules/@babel/core/lib/index.js:231:36)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Reproduce
- Clone repo as instructed in README
yarn install
yarn start
node v10.16.3
yarn v1.17.3
I have the same error
I have the same error
Same error!