Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7 breaks applications using ember-cli-babel v8 and multiple addons using this package #1259

Open
anehx opened this issue Jul 31, 2024 · 0 comments

Comments

@anehx
Copy link

anehx commented Jul 31, 2024

Hi there

With v7 of this package ember-cli-babel v8 support was added which is awesome! However, I've noticed that the build will break as soon as your application uses multiple addons that have a dependency on ember-test-selectors because the babel plugin is duplicated:

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": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js",
    "dirname": "/home/jimmy/work/ebau/camac-ng/ember-ebau",
    "ownPass": false,
    "file": {
      "request": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js",
      "resolved": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js"
    }
  },
  {
    "alias": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js",
    "dirname": "/home/jimmy/work/ebau/camac-ng/ember-ebau",
    "ownPass": false,
    "file": {
      "request": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js",
      "resolved": "/home/jimmy/work/ebau/camac-ng/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/ember-test-selectors/strip-data-test-properties-plugin6.js"
    }
  }
]

I think the right solution would be to only add the plugin to the babel options if it doesn't exist yet. However, I don't have any experience with babel plugins so I'd appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant