OverZealous / lazypipe

Lazily create a pipeline out of reusable components. Useful for gulp.
MIT License
311 stars 10 forks source link

Error: Invalid call to lazypipe().pipe(): no stream creation function specified #26

Closed Rebaiahmed closed 7 years ago

Rebaiahmed commented 7 years ago

Hi i get this error when i run gulp in my terminal command Linux gulp_issues

OverZealous commented 7 years ago

Says it pretty clearly—you are trying to initialize a lazypipe without passing in any streams.

Rebaiahmed commented 7 years ago

But i didn't touch the code , i just installed gulp , when i run it in terminal i get this error , so what i should do ?

OverZealous commented 7 years ago

I don't know what you are asking me. That doesn't make sense. Lazypipe doesn't come with gulp. It also doesn't run anything by default.

It even says the error occurs on like 43 of your gulpfile. So you at least have a gulpfile installed.

jmcollin78 commented 7 years ago

Same problem for me. After upgrading gulp (I think) the following code throw the same exception as above:

var compassPkg = function (p) {
    var assetsPkg = 'packages/' + p + '/public/assets';
    var scssPkg = 'packages/' + p + '/public/assets/scss/*.scss';
    if (glob.sync(scssPkg).length > 0) {
        var compassOptions = {
            css: assetsPkg + '/css',
            sass: assetsPkg + '/scss',
            image: assetsPkg + '/img',
            relative: true,
            import_path: 'packages/system/public/assets/scss',
            environment: environment === 'production' ? 'production' : 'development',
            http_path: '/'
        };
        return (lazypipe()                                           
            .pipe(compass, compassOptions)
            .pipe(csslint)
            .pipe(csslint.reporter)                                <--- problem is here
            .pipe(csslint.failReporter)
            .pipe(livereload)
        )();
    } else {
        console.log('No sccs files was found for package "%s"', p);
        return lazypipe().pipe(livereload)();
    }
};

The exception is:

[12:04:10] Starting 'compass'...
Compass all scss in "packages/*/public/assets/scss/*.scss" dir
[12:04:10] 'compass' errored after 44 ms
[12:04:10] Error: Invalid call to lazypipe().pipe(): no stream creation function specified
    at validateStep (/home/vagrant/cld-apps/node_modules/lazypipe/index.js:9:10)
    at Function.build.pipe (/home/vagrant/cld-apps/node_modules/lazypipe/index.js:36:4)
    at compassPkg (/datas/cld-apps/gulpfile.js:138:14)
    at Gulp.<anonymous> (/datas/cld-apps/gulpfile.js:168:15)
    at module.exports (/home/vagrant/cld-apps/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/home/vagrant/cld-apps/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/home/vagrant/cld-apps/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/home/vagrant/cld-apps/node_modules/orchestrator/index.js:134:8)
    at /home/vagrant/.nvm/versions/node/v7.5.0/lib/node_modules/gulp/bin/gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

I guess something change in Gulp or lazypipe which leads to the exception.

Release are:

 "lazypipe": "1.0.1",
 $ gulp --version
[12:10:02] CLI version 3.9.1
[12:10:02] Local version 3.9.1

Any help would be appreciated.

jmcollin78 commented 7 years ago

OK. The error comes from upgrading ccslint to 1.0 which introduce a non documented breaking change. More here: https://github.com/lazd/gulp-csslint/issues/59

OverZealous commented 7 years ago

@jmcollin78 Thanks for digging into that. Definitely not an issue with lazypipe then.

@Rebaiahmed Can you confirm that this is the same or a similar issue? The only reason you'd see this error is if you are passing in undefined or something else that is not a function to .pipe(), which is why it explains that in the error.

OverZealous commented 7 years ago

Closing as there's been no further communication.

opyate commented 7 years ago

There could be a more general issue here with how lazypipe reports a missing/broken stream creation function. E.g from slush-angular template at the time of writing:

/**
 * Build AngularJS templates/partials
 */
function buildTemplates () {
  return lazypipe()
    .pipe(g.ngHtml2js, {  // <------- breaks here with Error: Invalid call to lazypipe().pipe(): no stream creation function specified
      moduleName: bower.name,
      prefix: '/' + bower.name + '/',
      stripPrefix: '/app'
    })
    .pipe(g.concat, bower.name + '-templates.js')
    .pipe(gulp.dest, './.tmp')
    .pipe(livereload)();
}

And it's fixed with npm install --save-dev gulp-ng-html2js.