miickel / gulp-angular-templatecache

Concatenates and registers AngularJS templates in the $templateCache.
MIT License
524 stars 103 forks source link

gulp-angular-templatecache breaks plumber #137

Closed arty-name closed 6 years ago

arty-name commented 8 years ago

I have this task running with gulp-watch:

  gulp.src('./app/**/*.jade')
    .pipe(p.plumber(plumberConf))
    .pipe(p.pug({ doctype: 'html' }))
    .pipe(p.angularTemplatecache('templates.js', { standalone: true }))
    .pipe(gulp.dest(path.dest)));

Whenever there is an error during templates compilation, the gulp-watch exits even despite I have gulp-plumber in place. However when I comment out the piping to gulp-angular-templatecache the errors are handled by plumber gracefully, as they should be. Here’s a stack trace:

node_modules/map-stream/index.js:90
    if(ended) throw new Error('map stream is not writable')
              ^

Error: map stream is not writable
    at Stream.stream.write (node_modules/map-stream/index.js:90:21)
    at Stream.method [as write] (node_modules/duplexer/index.js:47:39)
    at DestroyableTransform.ondata (node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:531:20)
    at emitOne (events.js:96:13)
    at DestroyableTransform.emit (events.js:188:7)
    at readableAddChunk (node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:198:18)
    at DestroyableTransform.Readable.push (node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:157:10)
    at DestroyableTransform.Transform.push (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:123:32)
    at afterTransform (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:79:51)
    at TransformState.afterTransform (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:58:12)
    at DestroyableTransform._transform (node_modules/gulp-pug/index.js:45:5)
    at DestroyableTransform.Transform._read (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
    at DestroyableTransform.Writable.write (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)

Process finished with exit code 1
simonua commented 6 years ago

Hi @arty-name, do you have a reproducible case you can share, please?

arty-name commented 6 years ago

Not after two years, no...

simonua commented 6 years ago

@arty-name, that's very understandable. I'll close this out then.