verekia/js-stack-from-scratch

yarn start hangs after 3rd chapter

bduffin opened this issue · 3 comments

Type of issue: bug

Chapter: 3

After completing the 3rd chapter and running "yarn start", the gulp tasks run successfully. But the process never exists, so I have to use ctrl-c to kill the process. This wasn't a big deal, but I think it might be affecting later parts of the tutorial.

3-es6-babel-gulp bd017894$ yarn start
yarn start v0.18.1
$ gulp 
[14:09:52] Using gulpfile /workspace/nascar/temp-from-site/js-stack-from-scratch/tutorial/3-es6-babel-gulp/gulpfile.js
[14:09:52] Starting 'watch'...
[14:09:52] Finished 'watch' after 8.17 ms
[14:09:52] Starting 'clean'...
[14:09:52] Finished 'clean' after 4.28 ms
[14:09:52] Starting 'build'...
[14:09:52] Finished 'build' after 122 ms
[14:09:52] Starting 'main'...
Hello ES6 now

[14:09:52] Finished 'main' after 67 ms
[14:09:52] Starting 'default'...
[14:09:52] Finished 'default' after 24 μs
^C

To verify it's not an issue with my code, I cloned this git repo and navigated to the directory for the 3rd chapter. After running the "yarn add" commands, I ran "yarn start" which hung as well.

I suspect it may be an issue with an NPM dependency, similar to this one: gulpjs/gulp#903

Yarn start is running the command gulp.

Gulp runs its default task, which will run watch and main.
gulp.task('default', ['watch', 'main']);

And watch has a command gulp.watch which is watching for changes, hence the process does not exit. I think this is intended.

gulp.task('watch', () => { gulp.watch(paths.allSrcJs, ['main']); });

Thanks for the clarification, @unwiLL. With that in mind, I read closer and noticed this snippet: "Run yarn start. It should print "Hello ES6" and start watching for changes." It would be helpful if the tutorial could be updated to explain this a little more thoroughly, perhaps with a suggestion to open a new terminal tab to continue working while the watch runs (or a command to run it in the background?).

Clarified in the new release of the tutorial :)