Running yarn dev after a fresh clone & install fails due to duplicate babel plugin/preset
See original GitHub issueHi! I just started your course and ran into an issue getting up and running. Upon running yarn dev
, I see this error:
➜ yarn dev
yarn run v1.22.5
$ node ./server/index.js
⠋ Building...Serving on http://localhost:3000
🚨 /Users/josie.flynn/dev/professional-ts/src/index.js: Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.
plugins: [
['some-plugin', {}],
['some-plugin', {}, 'some unique name'],
]
Duplicates detected are:
[
{
"alias": "/Users/josie.flynn/dev/professional-ts/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
"dirname": "/Users/josie.flynn/dev/professional-ts",
"ownPass": false,
"file": {
"request": "@babel/plugin-proposal-class-properties",
"resolved": "/Users/josie.flynn/dev/professional-ts/node_modules/@babel/plugin-proposal-class-properties/lib/index.js"
}
},
{
"alias": "base$1",
"options": {
"loose": "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"
},
"dirname": "/Users/josie.flynn/dev/professional-ts",
"ownPass": false
I think this is happening because @babel/preset-env
now includes the @babel/plugin-proposal-class-properties
proposal as of their 7.10.0 release: https://babeljs.io/blog/2020/05/25/7.10.0#class-properties-and-private-methods-to-shippedproposals-option-of-babelpreset-env-11451httpsgithubcombabelbabelpull11451
Commenting out "plugins": ["@babel/plugin-proposal-class-properties"]
from .babelrc
seems to resolve the issue for me.
Thanks for putting your course together, it’s been great so far! Just wanted to submit this in case it helps other folks who got stuck on it too.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:42
- Comments:6
Top Results From Across the Web
Webencore Fails : Duplicate plugin/preset detected
Simple solution: just delete the "^" in "@babel/preset-react": "^7.0.0", from your package.json file, And run the npm install command after ...
Read more >@babel/preset-react | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
First, we need to install the Babel Rollup plugin and the appropriate Babel preset. # Install Rollup's Babel plugin. npm install --save-dev rollup-plugin-babel...
Read more >Babel issue running npm run dev after upgrade to Mix
Try deleting the node_modules folder and the package-lock.json file and run npm install again. Also check if you have any old dependencies or...
Read more >How to Create and Publish a React Component Library
npm install @my-github-account/my-cool-component-library ... You can initialize a default configuration by running the following command:.
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
This worked for me too! thanks
Thank you ❤️