ember-bootstrap/ember-bootstrap-power-select

Error when installing / running default blueprint

GendelfLugansk opened this issue · 2 comments

Installing v5 of this addon leads to error because version 5 of chalk were released as ES module and therefore does not support require (used by default blueprint of this addon

gennady@GENNADY-PC:~/projects/my-project$ ember install ember-bootstrap-power-select
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

🚧  Installing packages... This might take a couple of minutes.
yarn: Installed ember-bootstrap-power-select
require() of ES Module /home/gennady/projects/my-project/node_modules/ember-bootstrap-power-select/node_modules/chalk/source/index.js from /home/gennady/projects/my-project/node_modules/ember-bootstrap-power-select/blueprints/ember-bootstrap-power-select/index.js not supported.
Instead change the require of /home/gennady/projects/my-project/node_modules/ember-bootstrap-power-select/node_modules/chalk/source/index.js in /home/gennady/projects/my-project/node_modules/ember-bootstrap-power-select/blueprints/ember-bootstrap-power-select/index.js to a dynamic import() which is available in all CommonJS modules.


Stack Trace and Error Report: /tmp/error.dump.050c27e0d2a117ce140475c28e841c65.log

same issue... any short term work-arounds?

@drewcovi

  1. Use v4. I do not rememebr if ember install allows to specify version but if not, you can install using your package manager and then run default blueprint: ember g ember-bootstrap-power-select
  2. Install v5 using package manager, analyze what default blueprint does, and do needed setup work manually
  3. Install v4 (if ember install does not allow to select version - see p. 1) and then update version to v5 in package.json and do yarn/npm install. Given that blueprint did not change for the last year, this might work
  4. Fork the repo, fix the problem, make PR, use your fork for the time being. How to fix the problem - that's a good question. Simplest fix would be to lock chalk dependency to version where it was deployed as CommonJS (I guess that will be v4). However I am not sure such PR will be accepted by maintainers of this package. Another way is to actually update default blueprint to work with latest versions of chalk. Requires more effort, though.