我在使用gulp-angular-templatecache時遇到了一些困難。我有一個任務gulpfile:當管道角模板發生錯誤時吞吐角 - 模板緩存錯誤
gulp.task('templates', function() {
return gulp.src(paths.angularTemplates)
.pipe(templateCache())
/*.pipe(gulp.dest('javascript/angular'))*/;
});
我不知道爲什麼,但管道吞掉-角templatecache並拋出時拋出以下錯誤:
stream.js:74
throw er; // Unhandled stream error in pipe.
^
TypeError: Cannot read property 'toString' of null
at templateCacheFile (/home/vagrant/app/node_modules/gulp-angular-templatecache/index.js:89:40)
at wrappedMapper (/home/vagrant/app/node_modules/gulp-angular-templatecache/node_modules/event-stream/node_modules/map-stream/index.js:84:19)
at Stream.stream.write (/home/vagrant/app/node_modules/gulp-angular-templatecache/node_modules/event-stream/node_modules/map-stream/index.js:96:21)
at Stream.method [as write] (/home/vagrant/app/node_modules/gulp-angular-templatecache/node_modules/event-stream/node_modules/duplexer/index.js:47:39)
at write (/home/vagrant/app/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/home/vagrant/app/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/home/vagrant/app/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
at emitReadable_ (/home/vagrant/app/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
我不知道這個錯誤與什麼問題有關。任何幫助將不勝感激。
非常感謝。
嗨,你設法弄清楚了嗎?我剛剛在一個較老的項目上發現了同樣的問題。更新'gulp-angular-templatecache'沒有成功 –
是的,有一個更新的吞噬角 - 模板緩存版本打破了它。最終在gulp文件中指定特定的版本 – R14523