problem description
D:\client>yarn start
yarn run v1.12.3
$ react-app-rewired start
D:\client\config-overrides.js:3
config = injectBabelPlugin(["@babel/plugin-proposal-decorators", { legacy: true }], config);
^^^^^^
SyntaxError: Rest parameter may not have a default initializer
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-sharp-sharp-sharp
D:\client\src\component\Login.js: Support for the experimental syntax "decorators-legacy" isn"t currently enabled (14:5)
mobxmobx-reactconfig-overrides.js
module.exports = function override(config, env) {
...
config = injectBabelPlugin(["@babel/plugin-proposal-decorators", { legacy: true }], config);
return config;
}
An error in the description of the problem occurs after
related codes
/ / Please paste the code text below (do not replace the code with pictures)
config-overrides.js
module.exports = function override(config, env) {
...
config = injectBabelPlugin(["@babel/plugin-proposal-decorators", { legacy: true }], config);
return config;
}
package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.1.3",
"jquery": "^3.3.1",
"mobx": "^5.8.0",
"mobx-react": "^5.4.3",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"reactstrap": "^6.5.0"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"react-app-rewire-mobx": "^1.0.9",
"react-app-rewired": "^1.6.2"
}
}
what result do you expect? What is the error message actually seen?
want to run the react project successfully