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

Babel Plugin Error #297

Closed
devotox opened this issue Sep 23, 2019 · 17 comments · Fixed by #317, #322 or #324
Closed

Babel Plugin Error #297

devotox opened this issue Sep 23, 2019 · 17 comments · Fixed by #317, #322 or #324

Comments

@devotox
Copy link

devotox commented Sep 23, 2019

Description

When using ember-octane the bump from github:ember-cli/ember-cli-htmlbars#484f165c78aaed4fa5aa00d675ee7de905a8a47c to github:ember-cli/ember-cli-htmlbars#253503f1cda5bce173d65fd7b15de1f447cfa5e7 causes the error below.

I have tested all other changes and only this package causes the error

Console Error

Build Error (broccoli-persistent-filter:Babel > [Babel: account]) in account/components/basic-dropdown/content.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'],
  ]

It seems this error occurs when using this exact version of ember-cli-htmlbars with ember-engines as account/ is an in-repo-engine.

When I remove all engines from the package.json the build works again.

Log

=================================================================================

ENV Summary:

  TIME: Tue Sep 24 2019 00:25:55 GMT+0100 (British Summer Time)
  TITLE: ember
  ARGV:
  - /Users/devonte/.nvm/versions/node/v10.16.3/bin/node
  - /Users/devonte/Documents/Devonte/zenunu/node_modules/.bin/ember
  - serve
  EXEC_PATH: /Users/devonte/.nvm/versions/node/v10.16.3/bin/node
  TMPDIR: /var/folders/zp/9skf2wx96b37hdk3_rbd457m0000gn/T
  SHELL: /usr/local/bin/fish
  PATH:
  - /var/folders/zp/9skf2wx96b37hdk3_rbd457m0000gn/T/yarn--1569281110106-0.1583029301122636
  - /Users/devonte/Documents/Devonte/zenunu/node_modules/.bin
  - /Users/devonte/.config/yarn/link/node_modules/.bin
  - /Users/devonte/.nvm/versions/node/v10.16.3/libexec/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/devonte/.nvm/versions/node/v10.16.3/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/devonte/.nvm/versions/node/v10.16.3/bin/node_modules/npm/bin/node-gyp-bin
  - /Users/devonte/.nvm/versions/node/v10.16.3/bin
  - /Users/devonte/.gem/ruby/2.6.0/bin
  - /usr/local/Cellar/ruby/2.6.2/bin/
  - /usr/local/Cellar/ruby/2.6.2/lib/ruby/gems/2.6.0/bin
  - /usr/local/lib/ruby/gems/2.6.0/bin
  - /Users/devonte/go/bin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  PLATFORM: darwin x64
  FREEMEM: 37142528
  TOTALMEM: 17179869184
  UPTIME: 2131985
  LOADAVG: 5.2919921875,5.50146484375,6.220703125
  CPUS:
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz - 2200
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.15.0
  - brotli: 1.0.7
  - cldr: 35.1
  - http_parser: 2.8.0
  - icu: 64.2
  - modules: 64
  - napi: 4
  - nghttp2: 1.39.2
  - node: 10.16.3
  - openssl: 1.1.1c
  - tz: 2019a
  - unicode: 12.1
  - uv: 1.28.0
  - v8: 6.8.275.32-node.54
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: Error: 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'],
  ]
    at assertNoDuplicates (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:205:13)
    at createDescriptors (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at alias (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:63:49)
    at cachedFunction (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/caching.js:33:19)
    at plugins.plugins (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:319:26)
    at /Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:283:7
    at buildRootChain (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:68:29)
    at loadPrivatePartialConfig (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/partial.js:85:55)
  - code: [undefined]
  - codeFrame: 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'],
  ]
  - errorMessage: account/components/basic-dropdown/content.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'],
  ]
        in /var/folders/zp/9skf2wx96b37hdk3_rbd457m0000gn/T/broccoli-2434813No9clUHwWX/out-0891-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: account] (Babel: account)
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: account/components/basic-dropdown/content.js
    - line: [undefined]
    - treeDir: /var/folders/zp/9skf2wx96b37hdk3_rbd457m0000gn/T/broccoli-2434813No9clUHwWX/out-0891-funnel_funnel_addon_js
  - message: account/components/basic-dropdown/content.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'],
  ]
        in /var/folders/zp/9skf2wx96b37hdk3_rbd457m0000gn/T/broccoli-2434813No9clUHwWX/out-0891-funnel_funnel_addon_js
        at broccoli-persistent-filter:Babel > [Babel: account] (Babel: account)
  - name: BuildError
  - nodeAnnotation: Babel: account
  - nodeName: broccoli-persistent-filter:Babel > [Babel: account]
  - originalErrorMessage: 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'],
  ]
  - stack: Error: 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'],
  ]
    at assertNoDuplicates (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:205:13)
    at createDescriptors (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at alias (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:63:49)
    at cachedFunction (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/caching.js:33:19)
    at plugins.plugins (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:319:26)
    at /Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:283:7
    at buildRootChain (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/config-chain.js:68:29)
    at loadPrivatePartialConfig (/Users/devonte/Documents/Devonte/zenunu/node_modules/ember-cli-babel/node_modules/@babel/core/lib/config/partial.js:85:55)

=================================================================================
@buschtoens
Copy link

It seems that this issue only occurs, when addon A depends on addon B, but both list ember-cli-htmlbars as a dependency.

@devotox
Copy link
Author

devotox commented Oct 2, 2019

I tested this with v4.0.3 and still same issue. I also removed ember-cli-htmlbars-inline-precompile to see if that fixed it ... to no avail

@devotox
Copy link
Author

devotox commented Oct 2, 2019

I wonder if this has anything to do with the use of ember-engines as that is technically an addon and it does have ember-cli-htmlbars: * as a dependency

@rwjblue rwjblue reopened this Oct 2, 2019
@rwjblue
Copy link
Member

rwjblue commented Oct 2, 2019

I've reopened, but I doubt I'll be able to do much to help fix this or track it down without a reproduction. Gathering the repro may be enough to pin-point the issue also...

@devotox
Copy link
Author

devotox commented Oct 2, 2019

Here is the app I am working on https://github.com/devotox/zenunu

Changing the htmlbars in package.json for the error to occur

@rwjblue
Copy link
Member

rwjblue commented Oct 2, 2019

FWIW, this error message is pretty horrible. babel/babel#10419 is trying to make it better / more actionable.

@devotox
Copy link
Author

devotox commented Oct 2, 2019

https://github.com/babel/babel/pull/10419#issuecomment-537511250

I can try to follow your comment above to get more insight when I'm back at my computer

@rwjblue
Copy link
Member

rwjblue commented Oct 2, 2019

I tried to clone your repo, but get an error (RE: missing addon/styles directory) when I run ember build. I don't have time ATM to debug further, sorry.

@devotox
Copy link
Author

devotox commented Oct 2, 2019

Ha yes just need to mkdir addon/styles and addon/components.

@rwjblue
Copy link
Member

rwjblue commented Oct 2, 2019

#322 will fix (confirmed locally linking in your project)

@anehx
Copy link

anehx commented Oct 3, 2019

I just updated ember-cli-htmlbars to v4.0.4 my project but it still throws the same error: projectcaluma/ember-caluma#566

@rwjblue
Copy link
Member

rwjblue commented Oct 4, 2019

Thank you @anehx! I found more issues given your reproduction. Fixed in #324 (hopefully for good 😸).

@rwjblue
Copy link
Member

rwjblue commented Oct 4, 2019

Released as v4.0.5, please test and let me know.

@rwjblue rwjblue reopened this Oct 4, 2019
@buschtoens
Copy link

buschtoens commented Oct 5, 2019

It's working for me. 👍

Thanks a lot for fixing this so swiftly. ⚡️

@devotox
Copy link
Author

devotox commented Oct 7, 2019

Well this also works for me! Sooooo closing time!

@devotox devotox closed this as completed Oct 7, 2019
Copy link
Member

rwjblue commented Oct 7, 2019

Thanks for testing y’all, sorry it took so long.

@nightire
Copy link

I have reencountered this error with ember-cli-htmlbars@6.0.x; it only happened when using ember-engines.

I temporarily solve this problem by pinning ember-cli-htmlbars to 5.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment