scalableminds / chatroom

React-based Chatroom Component for Rasa Stack
https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/demo.html
GNU Affero General Public License v3.0
307 stars 206 forks source link

[Error] On plugin duplicate error on yarn build #139

Open varun-d opened 4 years ago

varun-d commented 4 years ago

On yarn build, the following error pops up. Simple fix to it.

yarn run v1.22.4
$ parcel build src/index.js --out-file Chatroom.js
🚨  /Users/<username>/Projects/chatrooms/chatroom_oracle/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/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
    "dirname": "/Users/<username>/Projects/chatrooms/chatroom_oracle",
    "ownPass": false,
    "file": {
      "request": "@babel/plugin-proposal-class-properties",
      "resolved": "/Users/<username>/Projects/chatrooms/chatroom_oracle/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/<username>/Projects/chatrooms/chatroom_oracle",
    "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/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
    "dirname": "/Users/<username>/Projects/chatrooms/chatroom_oracle",
    "ownPass": false,
    "file": {
      "request": "@babel/plugin-proposal-class-properties",
      "resolved": "/Users/<username>/Projects/chatrooms/chatroom_oracle/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/<username>/Projects/chatrooms/chatroom_oracle",
    "ownPass": false
  }
]
    at assertNoDuplicates (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-descriptors.js:206:13)
    at createDescriptors (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at /Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-descriptors.js:63:53
    at cachedFunction (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/gensync/index.js:244:28)
    at sync (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/gensync/index.js:84:14)
    at plugins (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/<username>/Projects/chatrooms/chatroom_oracle/node_modules/@babel/core/lib/config/config-chain.js:383:26)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Fix is for .babelrc file

 "plugins": [
    ["@babel/plugin-transform-flow-strip-types", {}, "unique-name-a"],
    ["@babel/plugin-syntax-class-properties", {}, "unique-name-b"],
    ["@babel/plugin-proposal-class-properties", {}, "unique-name-c"]
  ]

I can issue a new pull request if needed.

davclark commented 3 years ago

This is still broken

hotzenklotz commented 3 years ago

@varun-d Sorry, this got overlooked. Are you still interested in creating a pull request for your suggested fix?

varun-d commented 3 years ago

So sorry it's been a while and I don't even know if I have access anymore. Will have a look.