ember-cli: Error: Cannot start a build if one is already running
After upgrading to ember-cli 3.17.1 this error started popping up frequently.
If you have ember s running and editing files quickly it will show up.
Edit one file, save, go to another file, edit and save before the previous incremental build is finished, the “Cannot start a build if one is already running” error pops up and live-reload won’t recover. It needs to be restarted.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 19 (14 by maintainers)
Reverted the changes in https://github.com/broccolijs/broccoli/pull/459 and released as broccoli@3.4.1.
I believe this issue is actually fixed. If you are getting pinned to an older affected broccoli version, you may need to update your lock file…
Sorry about closing this issue and needing to reopen it. This issue was referenced from a PR in a private repo, and merging that PR apparently auto-closed this issue 😬
Ok, I believe the following should be done:
Changes in broccoli: Rather then
cancellingas is, we need to introduce the concept, using the existing cancellation plumbing, a retryable cancellation.It will more or less be.
builder.cancel(new RetryCancellationException('mid-build watch occurred, attempt retry')or simplybuilder.retry()and useRetryCancellationExceptioninternallybuilder.buildlearns aboutRetryCancellationException, and if a build fails do to aRetryCancellationExceptionit will internally restart itselfI’m going to disable this in broccoli + release now, then kick the tires on the above solution
There might be a better way of doing this too, but I was able to downgrade like this as a workaround:
Note that simply downgrading ember-cli won’t downgrade broccoli, because
^ranges make npm think that 3.4.0 is a safe upgrade.I’m sure there’s a fancypants way of doing this more easily with yarn too.
Edit: I suppose after downgrading broccoli, you can install
ember-cli@3.17too, since the transitive dep range didn’t change.