2016-09-06 49 views
0

我在使用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) 

我不知道這個錯誤與什麼問題有關。任何幫助將不勝感激。

非常感謝。

+0

嗨,你設法弄清楚了嗎?我剛剛在一個較老的項目上發現了同樣的問題。更新'gulp-angular-templatecache'沒有成功 –

+0

是的,有一個更新的吞噬角 - 模板緩存版本打破了它。最終在gulp文件中指定特定的版本 – R14523

回答

0

有一個更新的吞食角模板緩存版本打破了它。在我的項目中指定了一個特定的版本

0

在我的項目中,這是由一個帶有點的文件夾名稱引起的。 因此,我有一個名爲folder_name.html的文件夾,必須將其重命名爲folder_name

(使用gulp-angular-templatecache版本1.9.1)