Open iby opened 4 years ago
I'm seeing the same issues
Same issue, I included the versions I use. Sad, it's a pain to start node after every changes :cry:
[22:59:41] [nodemon] starting `node ./build/server.js`
{"level":30,"time":1585623581312,"pid":25258,"hostname":"","msg":"Server listening at http://127.0.0.1:3000","v":1}
{"level":30,"time":1585623581313,"pid":25258,"hostname":"","msg":"server listening on 3000","v":1}
[22:59:41] The following tasks did not complete: default, serve
[22:59:41] Did you forget to signal async completion?
Packages: "gulp-nodemon": "^2.5.0", "gulp": "^4.0.2", Node version: v12.16.1
Task
const serve = function(done) {
nodemon({
script: './build/server.js'
, ext: 'js html'
, env: { 'NODE_ENV': 'development' }
, done: done
})
};
I found quite a few watch-related issues, unfortunately none helped me with my case. I noticed two problems:
When stopping the task withControl+C the script fails with the following error. If I remove
watchFiles
orstartNodemon/BrowserSync
tasks, everything works fine.After trial and error I figured that if a callback gets passed/invoked in watch files task it would prevent the termination failure, however in approx. ⅓ launches the file watching wouldn't work. Literally. Upon one launch it behaves as expected when changing a file. Upon next launch it wouldn't see changes at all and won't run.
Here's the gulp file:
I tried removing BrowserSync out of the equation, but it doesn't seem to be making any difference. Is there any special treatment for the module or other workaround to make it work without throwing errors on exit and not using a callback with file watch task?