ember-cli: Intermittent build failures that require computer reboot
Our company uses Ember for multiple apps, and we have a common development environment configured on all of our developer machines.
A couple of months ago, we upgraded all of our apps from Ember 2.18 to Ember 3.5.1.
Since then, we intermittently encounter build failures that usually go along the lines of:
Could not find module `my-package/my-module` imported from `my-app/file`
The missing module varies, though ember-resolver has been one of the common ones.
Our usual method to fix this is remove node_modules and run yarn install. In some cases this doesn’t work, and the only solution is to reboot your machine.
I couldn’t find an existing issue for this, but the Jan 2019 coversation in this merged PR for ember-cli 3.5.0 indicates the use of system temp may be related.
I appreciate this issue is a bit vague, and hard to repro. We aim to collect more info about it, and will update this issue whenever we can. It has happened enough times now to be a Thing, so we’ll be more observant when it happens in future.
Output from ember version --verbose && npm --version && yarn --version:
$ ember version --verbose
ember-cli: 3.5.1
http_parser: 2.7.0
node: 6.9.2
v8: 5.1.281.88
uv: 1.9.1
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 57.1
modules: 48
openssl: 1.0.2j
os: darwin x64
$ npm --version
6.4.1
$ yarn --version
1.12.3
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 32 (19 by maintainers)
Commits related to this issue
- [Bugfix] make cache per file granularity, this accommodates per file cache eviction strategies * https://github.com/rwjblue/ember-cli-cjs-transform/issues/91 * https://github.com/ember-cli/ember-cli... — committed to stefanpenner/ember-cli-cjs-transform by stefanpenner 5 years ago
- [Bugfix] make cache per file granularity, this accommodates per file cache eviction strategies * https://github.com/rwjblue/ember-cli-cjs-transform/issues/91 * https://github.com/ember-cli/ember-cli/... — committed to stefanpenner/ember-cli-cjs-transform by stefanpenner 5 years ago
- [Bugfix] make cache per file granularity, this accommodates per file cache eviction strategies * https://github.com/rwjblue/ember-cli-cjs-transform/issues/91 * https://github.com/ember-cli/ember-cli/... — committed to rwjblue/ember-cli-cjs-transform by stefanpenner 5 years ago
Thanks for the fix @stefanpenner. We were consuming
ember-cli-cjs-transformviaember-rollbar-client, and have updated to the latest to get the fix.No recurrences of the issue for a couple of weeks, so it looks like it’s squashed.
(For those of you who haven’t upgraded cjs-transform yet, I found
rm -rf $TMPDIR/$USER/cjs-transformfixes this issue without a restart)@stefanpenner Alright, thank you Stefan, hope we’ll sort that out soon !
@stefanpenner yeah I see no reason why I couldn’t send you the
vendor.jsfile when I get the error again!If someone is importing
mergelike you say (import merge from 'lodash.merge') , it must be in an addon. I’ve grepped our codebase and we don’t import it like that anywhere. 🤔Welp I’m actually looking forward to getting this error again – I hope we’re able to make some progress figuring it out! I’ll hit you up on discord and save a copy of the vendor.js file regardless.
Also, based on the issues reported so far. My current guesses are that:
The offending state is being stored in a persistent manner, most likely in
$TMPDIR. A restart purges$TMPDIRwhich would then explain why a restart corrects this issue.I mentioned deleting
rm -rf $TMPDIR/$USERas this is typically wereasync-disk-cacheandsync-disk-cache, common libraries for broccoli plugins to store “warm build caches” stores, stores it’s persistent caches. If deleting it addresses the issue, it may help narrow down whats causing the issue.module is not definederror hints to me that potentially some CJS code, which expectsmoduleto be present, isn’t being converted safely…I am not super familiar with ember-auto-import and ember-lodash, so I will familiarize myself with…
@sdhull / @timiyay can you guys also be sure to share all browser console output each time the issue occurs? My hope is that it will help us narrow down a consistent source of those proceeding errors.