generator-polymer-init-custom-build
generator-polymer-init-custom-build copied to clipboard
writer after end error with gulp.watch
Somehow I run into an error when I try to add a gulp.swatch to the gulpfile.js.
Steps to reproduce:
- scaffold project
- add to the gulpfile.js:
gulp.task('watch',gulp.series('default',function() {
const watcher = gulp.watch('src/**/*.html');
watcher.on('all',gulp.series(['default']));
}));
- run
gulp watch
- modify
src/my-app.html
file - gulp.watch crashes with this error log:
[10:44:36] Starting 'watch'...
[10:44:36] Starting 'default'...
[10:44:36] Starting 'clean'...
[10:44:36] Finished 'clean' after 12 ms
[10:44:36] Starting 'output'...
[10:44:39] gulp-imagemin: Minified 6 images (saved 9.54 kB - 24.1%)
[10:44:42] Finished 'output' after 6.59 s
[10:44:42] Starting 'serviceWorker'...
[10:44:42] Finished 'serviceWorker' after 139 ms
[10:44:42] Finished 'default' after 6.74 s
[10:44:42] Starting '<anonymous>'...
[10:44:51] Starting 'default'...
[10:44:51] Starting 'clean'...
[10:44:51] Finished 'clean' after 191 ms
[10:44:51] Starting 'output'...
[10:44:51] Finished 'output' after 16 ms
[10:44:51] Starting 'serviceWorker'...
[10:44:51] 'serviceWorker' errored after 36 ms
[10:44:51] Error: ENOENT: no such file or directory, open 'build/bundled/service-worker.js'
at Error (native)
[10:44:51] 'default' errored after 248 ms
error: Error: write after end
at writeAfterEnd (_stream_writable.js:166:12)
at StreamAnalyzer.Writable.write (_stream_writable.js:217:5)
I am having the same issue, feelsbadman. If someone has any clue about this please consider sharing it.
Can confirm. I did a simplified gulp watch:
gulp.task('watch', function () {
gulp.watch('src/**/*.html', gulp.series('default'));
});
And I get the same error when it runs the 2nd time. My hunch is maybe this line is getting the incorrect path. Might suggest using gutil
to log it. Not sure if I'll be able to get to this before the Summit next week
@robdodson any updates on this?
@bm2u no unfortunately I haven't had much time to look into it. I'd welcome any help to try to debug it :)
This might help at least some people (who are using gulp-filter), who landed in this thread googling the error: https://stackoverflow.com/a/29617943/2477364
This remains a problem, and makes this tool unusable for us, even in a very minimalist, simplified app.
@teddyward I'd suggest using Polymer CLI if possible. I don't think anyone is able to maintain this generator.