prysmex / ember-eui

Ember Components for Elastic Eui
https://ember-eui.vercel.app
52 stars 11 forks source link

Initialization issues with 'ember-basic-dropdown' and 'ember-power-select' #181

Closed rdavid1099 closed 1 year ago

rdavid1099 commented 1 year ago

Problem

A new Ember app will not build with older versions of ember-basic-dropdown and ember-power-select which are both dependencies of @ember-eui/core.

Specs

"@ember-eui/core": "^6.5.4",
ember-cli: 5.1.0
node: 18.16.0
os: darwin arm64

Solution

I just started learning Ember this week and am working through some tutorials and messing around. I wanted to put in an out-of-the-box style solution and had issues with both ember-paper and ember-eui. The app throws an error when building for local development.

Cannot read properties of undefined (reading 'ember-cli-sass')
    at Class.included (<project directory>/node_modules/@ember-eui/core/node_modules/ember-power-select/index.js:26:50)
    at Class.superWrapper [as included] (<project directory>/node_modules/core-object/lib/assign-properties.js:34:20)
    at <project directory>/node_modules/ember-cli/lib/models/addon.js:475:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (<project directory>/node_modules/ember-cli/lib/models/addon.js:472:24)

When looking into the stack, it appears that older versions of both ember-basic-dropdown and ember-power-select, which are dependencies of ember-paper and ember-eui, check for plugins using the code below.

    let hasSass = !!app.registry.availablePlugins['ember-cli-sass'];
    let hasLess = !!app.registry.availablePlugins['ember-cli-less'];

I'm too new to the Ember ecosystem and don't know the initialization process, but I'm assuming that availablePlugins has been deprecated because updating those package versions to "ember-power-select": "^7.1.0" and "ember-basic-dropdown": "^7.2.1" changed the previous code block to this:

    const addons = app.project?.addonPackages || app.registry?.availablePlugins;
    const hasSass = !!addons['ember-cli-sass'];
    const hasLess = !!addons['ember-cli-less'];

After manually updating the dependencies in ember-eui, I was able to build and run the application without any issues.

betocantu93 commented 1 year ago

Hello! Thanks for creating the issue, I'll have a look at a fresh installation and make sure it works! Thanks

betocantu93 commented 1 year ago

Hello @rdavid1099, this issue has been fixed on v7.0.0! Thanks for reporting and I hope you find ember fun and productive

Rahien commented 11 months ago

Hey guys,

I had the same issue. Specs:

"@ember-eui/core": "^7.0.11",
ember-cli: 5.2.1
node: 18.15.0
os: linux x64

Had to add this to my package.json

  "overrides": {
    "ember-power-select": "^7.1.0",
    "ember-basic-dropdown": "^7.2.1"
  }

Thanks for the great work!

betocantu93 commented 11 months ago

I think it should now be solved in 7.1.1... tried it with "ember-auto-import": "^2.6.3"... had issued with ember-auto-import 2.4.x.