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

0.1.2 incompatible with addon usage #79

Closed
runspired opened this issue May 20, 2021 · 2 comments · Fixed by #80
Closed

0.1.2 incompatible with addon usage #79

runspired opened this issue May 20, 2021 · 2 comments · Fixed by #80

Comments

@runspired
Copy link
Contributor

To reproduce:

ember addon bug
cd bug
yarn add ember-cached-decorator-polyfill
ember build

Result

Build Error (Analyzer)

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/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js",
    "dirname": "/Users/runspired/github/temp/bug",
    "ownPass": false,
    "file": {
      "request": "/Users/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js",
      "resolved": "/Users/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js"
    }
  },
  {
    "alias": "/Users/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js",
    "dirname": "/Users/runspired/github/temp/bug",
    "ownPass": false,
    "file": {
      "request": "/Users/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js",
      "resolved": "/Users/runspired/github/temp/bug/node_modules/ember-cached-decorator-polyfill/lib/transpile-modules.js"
    }
  }
]


Stack Trace and Error Report: /var/folders/4q/mm5h2b_j0k743zhh3660przr0000gn/T/error.dump.824bc958ee0e4fc00b8b4e0b68e7152e.log
@runspired
Copy link
Contributor Author

I believe the issue is this line

if (!hasPlugin(app, 'ember-cache-decorator-polyfill')) {

not only is it misspelled (missing the d in cached), but looking at how hasPlugin works likely this needs to be the fully resolved path.

    if (!hasPlugin(app, 'ember-cache-decorator-polyfill')) {

@rwjblue
Copy link
Member

rwjblue commented May 20, 2021

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

Successfully merging a pull request may close this issue.

2 participants