adamayres / gulp-wrap

A gulp plugin to wrap the stream contents with a lodash template.
https://www.npmjs.com/package/gulp-wrap
MIT License
84 stars 17 forks source link

Unhandled rejection TypeError: tmpl is not a function #31

Closed paudr closed 8 years ago

paudr commented 8 years ago

Hi, gulp-wrap throws an exception when i use it.

Here ir the piece of code in my gulpfile.js:

gulp.task('build:word-merge', function() {
    return gulp.src('word-merge/*.js')
        .pipe(concat('word-merge.js'))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();')
        .pipe(gulp.dest(buildPath))
        .pipe(uglify())
        .pipe(rename('word-merge.min.js'))
        .pipe(gulp.dest(buildPath));
});

And here the console log:

Unhandled rejection TypeError: tmpl is not a function
    at D:\Proyectos\openxml.js\node_modules\consolidate\lib\consolidate.js:779:16
    at D:\Proyectos\openxml.js\node_modules\consolidate\lib\consolidate.js:143:5

    at Promise._execute (D:\Proyectos\openxml.js\node_modules\bluebird\js\release\debuggability.js:272:9)
    at Promise._resolveFromExecutor (D:\Proyectos\openxml.js\node_modules\bluebird\js\release\promise.js:473:18)
    at new Promise (D:\Proyectos\openxml.js\node_modules\bluebird\js\release\promise.js:77:14)
    at promisify (D:\Proyectos\openxml.js\node_modules\consolidate\lib\consolidate.js:136:10)
    at Function.exports.lodash.render (D:\Proyectos\openxml.js\node_modules\consolidate\lib\consolidate.js:775:10)
    at D:\Proyectos\openxml.js\node_modules\gulp-wrap\index.js:73:37
    at process._tickCallback (node.js:412:9)

For more info, I'm using the version 5.9.1 of node.js

Thanks

PS: sorry about my horrible english

BeijiYang commented 8 years ago

“tmpl is not a function”. It bothers me too... my node.js version is v5.11.1

BeijiYang commented 8 years ago

https://github.com/adamayres/gulp-wrap/pull/29/commits/fdc9f9d225782c83ca26ac9b9cdcb8636337b8b0 here is the solution. it helps a lot.

adamayres commented 8 years ago

Fixed by #29.