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

Cannot find module ember-cli/lib/broccoli/ember-app error in monorepo #7

Open
tomwayson opened this issue Apr 9, 2018 · 0 comments

Comments

@tomwayson
Copy link

After installing this into my ember app I get the following error when running ember asset-sizes:

Cannot find module '/Users/tom/<monorepo-root>/packages/<ember-app>/node_modules/ember-cli/lib/broccoli/ember-app'


Stack Trace and Error Report: /var/folders/_6/dgtlmj695fv5yds8f5hwvcbs8snz_f/T/error.dump.e5067a82d42b320f08aa37979af1831a.log
An error occurred in the constructor for ember-cli-asset-sizes-shim at /Users/tom/<monorepo-root>/node_modules/ember-cli-asset-sizes-shim

Note that my app is in a monorepo using yarn workspaces, so I have to use yarn add ember-cli-asset-sizes-shim and then ember generate ember-cli-asset-sizes-shim to install the addon, and that also returns the above error.

It looks like the error comes from these hardcoded paths:

var pathToApp = path.join(this.project.root, 'node_modules/ember-cli/lib/broccoli/ember-app');
var pathToAddonModel = path.join(this.project.root, 'node_modules/ember-cli/lib/models/addon');

Those would probably need to use require.resolve() in order to work in a monorepo.

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

1 participant