Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

writer after end error with gulp.watch #31

Open
timeu opened this issue Sep 1, 2016 · 7 comments
Open

writer after end error with gulp.watch #31

timeu opened this issue Sep 1, 2016 · 7 comments

Comments

@timeu
Copy link

timeu commented Sep 1, 2016

Somehow I run into an error when I try to add a gulp.swatch to the gulpfile.js.

Steps to reproduce:

  1. scaffold project
  2. add to the gulpfile.js:
gulp.task('watch',gulp.series('default',function() {
  const watcher = gulp.watch('src/**/*.html');
  watcher.on('all',gulp.series(['default']));
}));
  1. run gulp watch
  2. modify src/my-app.html file
  3. 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)
@willydouhard
Copy link

I am having the same issue, feelsbadman. If someone has any clue about this please consider sharing it.

@robdodson
Copy link
Contributor

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

@bm2u
Copy link

bm2u commented Aug 8, 2017

@robdodson any updates on this?

@robdodson
Copy link
Contributor

@bm2u no unfortunately I haven't had much time to look into it. I'd welcome any help to try to debug it :)

@Neonit
Copy link

Neonit commented Oct 16, 2017

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

@teddyward
Copy link

teddyward commented Apr 13, 2018

This remains a problem, and makes this tool unusable for us, even in a very minimalist, simplified app.

@robdodson
Copy link
Contributor

@teddyward I'd suggest using Polymer CLI if possible. I don't think anyone is able to maintain this generator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants