Comments (8)
Hi! 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-11451httpsgithubcombabelbabelpull11451Commenting 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.
This worked for me too! thanks
// .babelrc.js
{
"presets": [
["@babel/preset-env", { "targets": { "node": "10" } }],
"@babel/preset-react",
"@babel/preset-typescript"
]
// "plugins": ["@babel/plugin-proposal-class-properties"]
}
from professional-ts.
Wasted so much time on this. @mike-north consider fixing this because it really ruins the learning experience
from professional-ts.
Thanks for the suggestion, it did not work for me though. Is there anything else I could try to get the repo working?
from professional-ts.
Hi! 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-11451httpsgithubcombabelbabelpull11451Commenting 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.
This worked for me 👍 Thanks for the heads up
from professional-ts.
Thank you!
from professional-ts.
thanks it worked for me too
from professional-ts.
Thank you ❤️
from professional-ts.
Thanks for the info everyone. What I needed to do was:
- Remove the
@babel/plugin-proposal-class-properties
plugin from.babelrc
(as per @floroz answer). yarn remove @babel/plugin-proposal-class-properties
to avoid duplicate config warnings.- Update the browserlist db
npx browserslist@latest --update-db
to silence warnings.
Once those were done the application started up as expected.
from professional-ts.
Related Issues (10)
- 04-mikes-ts-setup.md - tsconfig composite misplaced
- 04-mikes-ts-setup.md - .eslintrc.json overrides
- 04-mikes-ts-setup.md - import path in a `index.test.ts` HOT 1
- typescript version=4.2.3 Cannot apply hunk #6 HOT 1
- Duplicate plugin/preset detected HOT 2
- Relative import for dtslint failing HOT 2
- Yarn@4 pnp breaks vscode / eslint integration HOT 1
- Running yarn on Apple M1 throws "Bad CPU type in executable" errors HOT 1
- yarn dtslint tests/types-dtslint fails with a Syntax error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from professional-ts.