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

Error when installing / running default blueprint #387

Open
GendelfLugansk opened this issue Jun 2, 2023 · 2 comments
Open

Error when installing / running default blueprint #387

GendelfLugansk opened this issue Jun 2, 2023 · 2 comments

Comments

@GendelfLugansk
Copy link

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
@drewcovi
Copy link

drewcovi commented Jun 7, 2023

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

@GendelfLugansk
Copy link
Author

@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.

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

2 participants