Closed lookfirst closed 9 years ago
@marjan-georgiev probably need to make build return a promise
It does return a promise. It feels more like the gulp lines in builder.buildTrees
(around building app...
) haven't finished.
@lookfirst - we just hit this on prod, will be fixed shortly
:+1:
I pushed a fix for this.
Edit: the fix is in the seed project. Will update this project too.
By the way, if you want to avoid 'Merge branch 'master' of github.com:Swimlane/angular-systemjs-seed" commits, then just git pull --rebase
.... ;-)
Also, please try to strive to make cleaner commits. A single commit should only have the changes associated with the commit message. Using a tool like SourceTree makes that really easy cause you can easily pick and choose which individual lines get included in a commit. The benefit is that it then becomes super easy to cherry pick commits as well as back out any commits if necessary.
I'm still seeing this issue in my project using the latest version of this code that is in master (1.0.6). Any ideas?
I just tried running gulp prod
on the latest master of your project, and it seems to be working fine?
Here's the output
[01:58:52] Starting 'prod'...
[01:58:52] Starting 'release'...
[01:58:52] Starting 'clean'...
[01:58:52] Finished 'clean' after 17 ms
[01:58:52] Starting 'compile'...
[01:58:52] Starting 'less'...
[01:58:52] Starting 'less-themes'...
[01:58:52] Starting 'html'...
[01:58:52] Starting 'es6'...
[01:58:52] Starting 'es6-coffee'...
[01:58:52] Starting 'json'...
[01:58:52] Starting 'move'...
[01:58:52] Finished 'json' after 303 ms
[01:58:52] Finished 'move' after 305 ms
[01:58:52] Finished 'es6-coffee' after 390 ms
[01:58:52] Finished 'less-themes' after 454 ms
[01:58:52] Finished 'less' after 467 ms
[01:58:52] Finished 'html' after 511 ms
[01:58:52] Finished 'es6' after 537 ms
[01:58:52] Finished 'compile' after 560 ms
[01:58:52] Starting 'cache-bust'...
[01:58:52] Finished 'cache-bust' after 7.08 ms
[01:58:52] Starting 'build'...
tracing source files...
generating bundles...
building...
building bundles...
building routes...
building app...
build succeeded
[01:58:57] Finished 'build' after 4.3 s
[01:58:57] Finished 'release' after 4.89 s
[01:58:57] Starting 'minify'...
[01:59:00] Finished 'minify' after 3.08 s
[01:59:00] Starting 'serve'...
[BS] Access URLs:
-----------------------------------
Local: http://localhost:9000
External: http://192.168.0.101:9000
-----------------------------------
[BS] Serving files from: dist/
[01:59:00] Finished 'serve' after 72 ms
[01:59:00] Finished 'prod' after 8.04 s
try again. i just pushed some big updates. note i have minify commented out. you'll also need to torch the local node_modules folder.
the problem is weird... it doesn't always happen. =( i think it has to do with some sort of buffering of the data.
Ran it 3 times, always the same output. Can you show me what it outputs when you run it?
[02:52:03] Requiring external module coffee-script/register
[02:52:04] Running as: production
[02:52:06] Using gulpfile ~/Projects/Playground/systemjs-seed/gulpfile.coffee
[02:52:06] Starting 'run'...
[02:52:06] Starting 'release'...
[02:52:06] Starting 'recompile'...
[02:52:06] Starting 'clean'...
[02:52:06] Finished 'clean' after 15 ms
[02:52:06] Starting 'compile'...
[02:52:06] Starting 'less'...
[02:52:06] Starting 'less-themes'...
[02:52:06] Starting 'html'...
[02:52:06] Starting 'es6'...
[02:52:06] Starting 'es6-coffee'...
[02:52:06] Starting 'json'...
[02:52:06] Starting 'copy'...
[02:52:06] Starting 'index.html'...
[02:52:06] Finished 'index.html' after 244 ms
[02:52:06] Finished 'json' after 306 ms
[02:52:06] Finished 'copy' after 341 ms
[02:52:07] Finished 'es6-coffee' after 445 ms
[02:52:07] Finished 'less-themes' after 476 ms
[02:52:07] Finished 'less' after 485 ms
[02:52:07] Finished 'html' after 551 ms
[02:52:07] Finished 'es6' after 607 ms
[02:52:07] Finished 'compile' after 625 ms
[02:52:07] Finished 'recompile' after 640 ms
[02:52:07] Starting 'cache-bust'...
[02:52:07] Finished 'cache-bust' after 12 ms
[02:52:07] Starting 'routeBundler'...
tracing source files...
generating bundles...
building...
building bundles...
building routes...
building app...
build succeeded
[02:52:11] Finished 'routeBundler' after 4.32 s
[02:52:11] Finished 'release' after 4.98 s
[02:52:11] Starting 'serve'...
[02:52:11] Finished 'serve' after 15 ms
[02:52:11] Finished 'run' after 4.99 s
[BS] Access URLs:
-----------------------------------
Local: http://localhost:9000
External: http://192.168.0.101:9000
-----------------------------------
[BS] Serving files from: dist/
Sure, the output is fine, but the error is that there is nothing in dist/app/app.js
You'll also need to uncomment the minify line in the gulpfile.
I just tried it and it worked fine, app.js was generated. But the issue is that it doesn't always work. There is some race condition of the routeBundler not fully finishing before minify runs.
In the seed project, I'm trying to
runSequence()
the route bundler (thebuild
task) and then call aminify
task, but due to the way that the bundler is async, the promise returned from thebuild()
method from the route bundler doesn't seem to be the final (first?) promise, so gulp has no idea whenbuild()
finishes and tries to run the minify task before the build task is done.