svenschoenung / gulp-parameterized

Parameterize gulp tasks
MIT License
1 stars 1 forks source link

Cannot run task with parameterized.series #1

Closed romablog closed 7 years ago

romablog commented 7 years ago
var gulp = require('gulp'),
        preprocess = require('gulp-preprocess'),
        rename = require('gulp-rename'),
        uglify = require('gulp-uglify'),
        del = require('del'),
        bump = require('gulp-bump');
    var parameterized = require('gulp-parameterized');

    gulp.task('preprocess', parameterized(function (done, params) {
        console.log(params);
    }));

    gulp.task('preprocess2', parameterized.series('preprocess --mock'));

when i run in console gulp preprocess2 then it fails with error

[15:13:59] Starting 'preprocesss2'...
[15:13:59] 'preprocesss2' errored after 1.1 ms
[15:13:59] TypeError: Cannot read property 'apply' of undefined
    at D:\dev\XHR\node_modules\gulp-parameterized\lib\composition.js:31:28
    at Gulp.taskFnWithParams (D:\dev\XHR\node_modules\gulp-parameterized\lib\task.js:39:12)
    at module.exports (D:\dev\XHR\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (D:\dev\XHR\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\dev\XHR\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (D:\dev\XHR\node_modules\orchestrator\index.js:134:8)
    at C:\Users\R.Gruzd\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
svenschoenung commented 7 years ago

It tried your example code. It works perfectly (except for the fact that you're not calling the done callback, but that's a different story).

Let me guess: you're using gulp 3.x? Then you're out of luck. This extension only works with gulp 4.0.