Open oliverlangan opened 5 years ago
Thanks, it sounds like there may be a legit bug here, in that we should fail consistently & early.
Clarifying question: when you say "except when building for production", is the issue that it only breaks with ember-cli's --environment=production
, or is the issue that it breaks when your addon is used by an app?
It is only broken when the app using the addon is built using --environment=production
. If the app is built for development, it works.
A workaround is that the app can also use ember-auto-import
and (in our case) loadash
, and the library will be found as expected.
Ok, so that is definitely concerning and we should figure out how to make it fail in development.
This is more a word of advice than an error, possibly useful in the docs.
Our addon uses in-repo addons (yes, addons within addons—long story), and we import
ember-auto-import
in the top level package.json file. This works for the most part, except when building for production.The solution is to make sure that
ember-auto-import
and the relevant libraries to be imported are also in the in-repo addon's package.json file, as dependencies per usual for use in an addon.