components icon indicating copy to clipboard operation
components copied to clipboard

"Duplicate plugin/preset detected." on npm run start

Open oussj opened this issue 4 years ago • 0 comments

Description

When running npm run start, a failure occur : "Duplicate plugin/preset detected."

Additional Data

OS : MacOS Catalina V10.15.3 Node version : v14.3.0 NPM version : 6.14.5

> [email protected] start /Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website
> parcel index.html

Server running at http://localhost:1234
🚨  /Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/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/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
    "options": {
      "loose": true
    },
    "dirname": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website",
    "ownPass": false,
    "file": {
      "request": "@babel/plugin-proposal-class-properties",
      "resolved": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/plugin-proposal-class-properties/lib/index.js"
    }
  },
  {
    "alias": "base$3",
    "options": {
      "loose": "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"
    },
    "dirname": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website",
    "ownPass": false
  }
]
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/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
    "options": {
      "loose": true
    },
    "dirname": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website",
    "ownPass": false,
    "file": {
      "request": "@babel/plugin-proposal-class-properties",
      "resolved": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/plugin-proposal-class-properties/lib/index.js"
    }
  },
  {
    "alias": "base$3",
    "options": {
      "loose": "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"
    },
    "dirname": "/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website",
    "ownPass": false
  }
]
    at assertNoDuplicates (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/config-descriptors.js:206:13)
    at createDescriptors (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at alias (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/config-descriptors.js:63:53)
    at cachedFunction (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/gensync/index.js:244:28)
    at sync (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/gensync/index.js:84:14)
    at plugins.plugins (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_static_frontend_with_s3/website/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/oussamah/Documents/Theodo/Formation/serverless/deploy_

Fix I used

I deleted

[
  "@babel/plugin-proposal-class-properties",
  {
    "loose": true
  }
],

from package.json

If the fix seems fine, I can do a Pull Request with it.

I'm not sure I understand the use of the lines I deleted to be honest, if someone has an article about I'll be happy to read it.

oussj avatar Jun 06 '20 19:06 oussj