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

Most upvoted comments

Thanks for the fix @stefanpenner. We were consuming ember-cli-cjs-transform via ember-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-transform fixes 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.js file when I get the error again!

If someone is importing merge like 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 $TMPDIR which would then explain why a restart corrects this issue.

I mentioned deleting rm -rf $TMPDIR/$USER as this is typically were async-disk-cache and sync-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 defined error hints to me that potentially some CJS code, which expects module to 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.