ember-cli-fastboot: Race condition prevents cleaning of dist folder between rebuilds

The first time I run a fastboot on a simple project, it works. Second time it crashes:

➜  moment-fastboot-example git:(master) NODE_DEBUG=fs ember fastboot --serve-assets
Installing FastBoot npm dependencies

Build successful - 12390ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
Babel                                         | 4257ms              
Babel                                         | 2892ms              
Babel                                         | 689ms               

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
Babel (30)                                    | 9917ms (330 ms)     

DEBUG: -------------------------------
DEBUG: Ember      : 2.7.0
DEBUG: Ember Data : 2.7.0
DEBUG: -------------------------------
Ember FastBoot running at http://[::]:3000
^C%                                                                                                                                                                                                                                                                          ➜  moment-fastboot-example git:(master) NODE_DEBUG=fs ember fastboot --serve-assets
Installing FastBoot npm dependencies

Build successful - 2498ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
SourceMapConcat: Concat: Vendor /assets/ve... | 135ms               

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
Babel (30)                                    | 678ms (22 ms)       
SourceMapConcat: Concat: Vendor /asset... (2) | 257ms (128 ms)      
JSHint templates (2)                          | 155ms (77 ms)       

fs.js:88
        throw backtrace;
        ^

Error: ENOTEMPTY: directory not empty, rmdir '/Users/gandalf/hacking/fastboot/moment-fastboot-example/dist/node_modules/moment/src/'
    at rethrow (fs.js:83:21)
    at maybeCallback (fs.js:101:42)
    at Object.fs.rmdir (fs.js:871:14)
    at TreeSync.<anonymous> (/Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/tree-sync/index.js:79:19)
    at Array.forEach (native)
    at TreeSync.sync (/Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/tree-sync/index.js:50:14)
    at CoreObject.module.exports.Task.extend.copyToOutputPath (/Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/ember-cli/lib/models/builder.js:173:10)
    at /Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/ember-cli/lib/models/builder.js:187:21
    at lib$rsvp$$internal$$tryCatch (/Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/gandalf/hacking/fastboot/moment-fastboot-example/node_modules/rsvp/dist/rsvp.js:505:17)

Repository that I used to test: https://github.com/gandalfar/moment-fastboot-example

➜  moment-fastboot-example git:(master) ember -v
ember-cli: 2.7.0
node: 6.2.1
os: darwin x64

Connected ticket with a bit more discussion: https://github.com/jasonmit/ember-cli-moment-shim/issues/55

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 20 (10 by maintainers)

Most upvoted comments

This should be solved by #356 . We should close this once that lands.

Running ember s also fixes fastboot. So that it runs once correctly again.

master (soon rc.1) should address this

Is this fixed yet? I also ran into the couldn't find package.json issue. I ran ember build and tried again, and now I’m getting an document is not defined error.