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

Adding ember-data to project breaks the build complaining about two separate instances of a plugin #7430

Closed
andreisebastianc-ccc opened this issue Feb 15, 2021 · 13 comments

Comments

@andreisebastianc-ccc
Copy link

I have a client-only app that I'm transitioning to consume data from a server with DB. I proceeded to add Mirage for mocks and Ember Data.

I ran ember install ember-data.
Tried removing Mirage and installing ember-data and got the same result. Removed lockfile and ran npm install and got the same result.

This may be a thing that's easy to fix if you know what you're looking for but I did not find useful info about how to handle this problem.

Let me know if there's something else I can do to provide more info.

Description

Build Error (broccoli-persistent-filter:Babel > [Babel: @ember/ordered-set]) in @ember/ordered-set/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/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]

Stack Trace and Error Report: /var/folders/5v/thww3h7n2rx_mydbv4bm786m0000gp/T/error.dump.10bb5f062417805c96b931e2b077b3aa.log
Stack Trace
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'],
  ]

Duplicates detected are:
[
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
    at assertNoDuplicates (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:206:13)
    at createDescriptors (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at /Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:63:53
    at cachedFunction (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/gensync/index.js:244:28)
    at sync (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/gensync/index.js:84:14)
    at plugins (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-chain.js:415:26)
  - 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'],
  ]

Duplicates detected are:
[
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
  - errorMessage: @ember/ordered-set/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/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
        in /var/folders/5v/thww3h7n2rx_mydbv4bm786m0000gp/T/broccoli-21192l5f7G0c3f8cs/out-204-funnel_funnel_ember_ordered_set_addon
        at broccoli-persistent-filter:Babel > [Babel: @ember/ordered-set] (Babel: @ember/ordered-set)
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: @ember/ordered-set/index.js
    - line: [undefined]
    - treeDir: /var/folders/5v/thww3h7n2rx_mydbv4bm786m0000gp/T/broccoli-21192l5f7G0c3f8cs/out-204-funnel_funnel_ember_ordered_set_addon
  - message: @ember/ordered-set/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/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
        in /var/folders/5v/thww3h7n2rx_mydbv4bm786m0000gp/T/broccoli-21192l5f7G0c3f8cs/out-204-funnel_funnel_ember_ordered_set_addon
        at broccoli-persistent-filter:Babel > [Babel: @ember/ordered-set] (Babel: @ember/ordered-set)
  - name: Error
  - nodeAnnotation: Babel: @ember/ordered-set
  - nodeName: broccoli-persistent-filter:Babel > [Babel: @ember/ordered-set]
  - 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'],
  ]

Duplicates detected are:
[
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
  - 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'],
  ]

Duplicates detected are:
[
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  },
  {
    "alias": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
    "options": {
      "emberVersion": "3.24.0",
      "root": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
      "name": "@ember/ordered-set"
    },
    "dirname": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app",
    "ownPass": false,
    "file": {
      "request": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js",
      "resolved": "/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/ember-compatibility-helpers/comparision-plugin.js"
    }
  }
]
    at assertNoDuplicates (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:206:13)
    at createDescriptors (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
    at createPluginDescriptors (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
    at /Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:63:53
    at cachedFunction (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/gensync/index.js:244:28)
    at sync (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/gensync/index.js:84:14)
    at plugins (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
    at mergeChainOpts (/Users/acimpean/Projects/authors-graph/covid19-kgraph-app/node_modules/broccoli-babel-transpiler/node_modules/@babel/core/lib/config/config-chain.js:415:26)

=================================================================================
Original package.json
"devDependencies": {
  "@csstools/postcss-sass": "^4.0.0",
  "@ember/optional-features": "^2.0.0",
  "@ember/render-modifiers": "^1.0.2",
  "@ember/test-helpers": "^2.1.4",
  "@fullhuman/postcss-purgecss": "^3.0.0",
  "@glimmer/component": "^1.0.3",
  "@glimmer/tracking": "^1.0.3",
  "@interactjs/types": "^1.10.2",
  "@types/ember": "^3.16.2",
  "@types/ember-qunit": "^3.4.13",
  "@types/ember__test-helpers": "^1.7.3",
  "@types/qunit": "^2.11.1",
  "@types/rsvp": "^4.0.3",
  "autoprefixer": "^10.1.0",
  "babel-eslint": "^10.1.0",
  "broccoli-asset-rev": "^3.0.0",
  "ember-auto-import": "^1.10.1",
  "ember-cached-decorator-polyfill": "^0.1.0",
  "ember-cli": "^3.24.0",
  "ember-cli-app-version": "^4.0.0",
  "ember-cli-babel": "^7.23.0",
  "ember-cli-dependency-checker": "^3.2.0",
  "ember-cli-htmlbars": "^5.3.1",
  "ember-cli-inject-live-reload": "^2.0.2",
  "ember-cli-inline-content": "^0.4.1",
  "ember-cli-mirage": "^2.0.1",
  "ember-cli-postcss": "^6.0.1",
  "ember-cli-sri": "^2.1.1",
  "ember-cli-terser": "^4.0.1",
  "ember-cli-typescript": "^4.0.0",
  "ember-cli-typescript-blueprints": "^3.0.0",
  "ember-cli-workbox": "^2.0.0",
  "ember-click-outside": "^2.0.0-beta.1",
  "ember-composable-helpers": "^4.4.1",
  "ember-concurrency": "^1.3.0",
  "ember-concurrency-decorators": "^2.0.3",
  "ember-concurrency-ts": "^0.2.0",
  "ember-did-resize-modifier": "^1.0.0",
  "ember-export-application-global": "^2.0.1",
  "ember-fetch": "^8.0.2",
  "ember-get-config": "^0.3.0",
  "ember-intl": "^5.6.0",
  "ember-key-manager": "^1.0.0",
  "ember-load-initializers": "^2.1.2",
  "ember-local-storage": "^1.7.2",
  "ember-math-helpers": "^2.15.0",
  "ember-maybe-import-regenerator": "^0.1.6",
  "ember-modifier": "^2.1.1",
  "ember-qunit": "^5.1.1",
  "ember-resolver": "^8.0.2",
  "ember-sortable": "^2.2.1",
  "ember-source": "^3.24.0",
  "ember-svg-jar": "^2.2.3",
  "ember-template-lint": "^2.16.0",
  "ember-test-selectors": "^5.0.0",
  "ember-truth-helpers": "^3.0.0",
  "ember-web-app": "^5.0.1",
  "eslint": "^7.17.0",
  "eslint-plugin-ember": "^10.1.2",
  "eslint-plugin-node": "^11.1.0",
  "loader.js": "^4.7.0",
  "npm-check": "^5.9.2",
  "npm-run-all": "^4.1.5",
  "postcss": "^8.2.4",
  "postcss-import": "^13.0.0",
  "postcss-scss": "^3.0.4",
  "qunit": "^2.14.0",
  "qunit-dom": "^1.6.0",
  "rup-styles": "^1.1.1",
  "sass": "^1.32.4",
  "tailwindcss": "^2.0.2",
  "tracked-maps-and-sets": "^2.2.1",
  "typescript": "^4.1.3"
},
"engines": {
  "node": "10.* || >= 12"
},
"ember": {
  "edition": "octane"
},
"dependencies": {
  "cytoscape": "^3.17.1",
  "cytoscape-bubblesets": "^3.0.0-alpha.0",
  "cytoscape-fcose": "^1.2.3",
  "cytoscape-popper": "^1.0.7",
  "d3": "^6.3.1",
  "idb": "^5.0.8",
  "interactjs": "^1.10.2"
},

Versions

Tried with both 3.25 and 3.24 and got the same result, an import and some content inlined.

npm list ember-source && npm list ember-cli && npm list --pattern ember-data
xxx
└── ember-source@3.24.0

xxx
└── ember-cli@3.24.0

xxx
└── ember-data@3.25.0

In ember-cli-build.js I have tailwind and purgecss config.

ember-cli-build.js
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const tailwindcss = require('tailwindcss');
const toPurgeCSS = EmberApp.env() === 'production';

const purgeCSS = {
  module: require('@fullhuman/postcss-purgecss'),
  options: {
    content: [
      // add extra paths here for components/controllers which include tailwind classes
      './app/index.html',
      './app/templates/**/*.hbs',
      './app/components/**/*.hbs'
    ],
    defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || []
  }
}

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    inlineContent: {
      metrics: 'public/3-graph-metrics.txt'
    },
    // Add options here
    postcssOptions: {
      compile: {
        extension: 'scss',
        enabled: true,
        parser: require('postcss-scss'),
        plugins: [
          {
            module: require('@csstools/postcss-sass'),
            options: {
              includePaths: [
                'node_modules'
              ],
              safelist: [
                'shadow-border-gutter',
                'gutter',
                // for the resizable widgets that are dynamically handled
                '.re-sizable',
                '.resizer',
                '.bottom',
                '.bottomRight',
                '.bottomLeft',
                'bottom-30px'
              ]
            }
          },
          tailwindcss('app/styles/tailwind.js'),
          ...toPurgeCSS ? [purgeCSS] : []
        ]
      },
    }
  });

  // Use `app.import` to add additional libraries to the generated
  // output files.
  //
  // If you need to use different assets in different
  // environments, specify an object as the first parameter. That
  // object's keys should be the environment name and the values
  // should be the asset to use in that environment.
  //
  // If the library that you are including contains AMD or ES6
  // modules that you would like to import into your application
  // please specify an object with the list of modules as keys
  // along with the exports of each module as its value.

  app.import('vendor/numeric-1.2.6.js');

  return app.toTree();
};
@jcardali
Copy link

jcardali commented Mar 3, 2021

I have the same issue when trying to upgrade to latest Ember using ember-cli-update

@mehulkar
Copy link

mehulkar commented Mar 6, 2021

Same issue on a longstanding app. Seems fine in 3.23, throws like this in 3.24.

Seems related to this: #7369

@snewcomer
Copy link
Contributor

@andreisebastianc-ccc I'm guessing your reproduction steps including blowing away node_modules as well? I'm wondering if duplicate arrived there b/c the node_modules were never cleared.

What does it show in your project when you run npm list ember-compatibility-helpers?

@andreisebastianc-ccc
Copy link
Author

andreisebastianc-ccc commented Mar 8, 2021

@snewcomer Yes, it reproduces regardless of what I do to the package-lock.json and node_modules folder

npm list ember-compatibility-helpers
covid-19-knowledge-graph@0.0.75 /Users/acimpean/Projects/authors-graph/covid19-kgraph-app
├─┬ @ember/render-modifiers@1.0.2
│ └─┬ ember-modifier-manager-polyfill@1.2.0
│   └── ember-compatibility-helpers@1.2.0  deduped
├─┬ @ember/test-helpers@2.1.4
│ └─┬ ember-destroyable-polyfill@2.0.2
│   └── ember-compatibility-helpers@1.2.1
├─┬ @glimmer/component@1.0.3
│ └── ember-compatibility-helpers@1.2.0
├─┬ ember-cached-decorator-polyfill@0.1.0
│ └─┬ ember-cache-primitive-polyfill@1.0.0
│   └── ember-compatibility-helpers@1.2.1
├─┬ ember-click-outside@2.0.0-beta.1
│ └─┬ ember-modifier@1.0.5
│   └── ember-compatibility-helpers@1.2.1
├─┬ ember-concurrency@1.3.0
│ └── ember-compatibility-helpers@1.2.0  deduped
└─┬ ember-sortable@2.2.1
  └─┬ ember-decorators-polyfill@1.1.5
    └── ember-compatibility-helpers@1.2.0  deduped

@runspired
Copy link
Contributor

As we no longer depend on @ember/ordered-set on canary, I am closing this for now.

@eelke
Copy link

eelke commented Apr 21, 2021

As we no longer depend on @ember/ordered-set on canary, I am closing this for now.

@runspired I also ran into this issue, after running ember-cli-update. Which version of ember-data should I change to in order to stop this from happening? Not sure what version you consider 'canary'. Thanks!

Edit: reverting to "ember-data": "~3.23.0", 'fixes' the issue for now

@jcardali
Copy link

As we no longer depend on @ember/ordered-set on canary, I am closing this for now.

@runspired I also ran into this issue, after running ember-cli-update. Which version of ember-data should I change to in order to stop this from happening? Not sure what version you consider 'canary'. Thanks!

Edit: reverting to "ember-data": "~3.23.0", 'fixes' the issue for now

Also wondering this @runspired, I tried using ember-cli-update to go to 3.26, and am seeing the same problem.

@runspired
Copy link
Contributor

@jcardali you'd want to figure out whatever else was bringing in ordered-set and figure out why it was a different version.

@jcardali
Copy link

I'm pretty sure ember-data was still bringing it in, hence the question.

@runspired
Copy link
Contributor

@jcardali yes for current release it does, but I think this error is because something else is also installing it and bringing a different version.

@runspired
Copy link
Contributor

runspired commented Jun 2, 2021

@mehulkar was able to debug a reproduction of this and I was able to help him narrow down to the specific problem being multiple versions of ember-compatibility-helpers being present, some of which do not have a fix for adding duplicate plugins for a scenario that @ember/ordered-set can trigger. That issue was described and fixed in ember-cli/ember-compatibility-helpers#36 which was included in the 1.2.1 release.

I've known for some time this had to be a dependency drift related issue since our own tests, test apps, test addons, and external partner apps and addons had not triggered this. In each case encountered blowing away node_modules and the lock file and then re-installing had resolved the issue. Now that the specific offender is known, a simpler fix is to update just the specific dep.

For yarn users

npx yarn-deduplicate

or

npx yarn-deduplicate --package ember-compatibility-helpers

For npm users

npm --depth 20 update ember-compatibility-helpers

@jcardali
Copy link

Unfortunately that still does not address the issue, it seems I have no choice but to wait for these underlying packages to get to ember-compatibility-helpers@1.2.1 (which may never happen 😢 )

 $ npm ls ember-compatibility-helpers
├─┬ @ember/render-modifiers@1.0.2
│ └─┬ ember-modifier-manager-polyfill@1.2.0
│   └── ember-compatibility-helpers@1.2.0  deduped
├─┬ @ember/test-helpers@2.2.8
│ └─┬ ember-destroyable-polyfill@2.0.3
│   └── ember-compatibility-helpers@1.2.4 
├─┬ @glimmer/component@1.0.4
│ └── ember-compatibility-helpers@1.2.0 
└─┬ ember-data@3.26.0
  ├─┬ @ember-data/model@3.26.0
  │ └── ember-compatibility-helpers@1.2.0  deduped
  └─┬ @ember/ordered-set@4.0.0
    └── ember-compatibility-helpers@1.2.0  deduped

@mehulkar
Copy link

Assuming those packages don’t pin to 1.2.0, you can choose the nuclear option (delete the lock file and node_modules) and run npm install.

backspace added a commit to backspace/prison-rideshare-ui that referenced this issue Sep 29, 2023
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

6 participants