Git Product home page Git Product logo

Comments (8)

floroz avatar floroz commented on September 13, 2024 14

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-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.

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.

youssef-tharwat avatar youssef-tharwat commented on September 13, 2024 2

Wasted so much time on this. @mike-north consider fixing this because it really ruins the learning experience

from professional-ts.

carlorizzante avatar carlorizzante commented on September 13, 2024

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.

ScottTear-Which avatar ScottTear-Which commented on September 13, 2024

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-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.

This worked for me 👍 Thanks for the heads up

from professional-ts.

maximimby avatar maximimby commented on September 13, 2024

Thank you!

from professional-ts.

tarandeep-simform avatar tarandeep-simform commented on September 13, 2024

thanks it worked for me too

from professional-ts.

satyambnsal avatar satyambnsal commented on September 13, 2024

Thank you ❤️

from professional-ts.

johnhunter avatar johnhunter commented on September 13, 2024

Thanks for the info everyone. What I needed to do was:

  1. Remove the @babel/plugin-proposal-class-properties plugin from .babelrc (as per @floroz answer).
  2. yarn remove @babel/plugin-proposal-class-properties to avoid duplicate config warnings.
  3. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.