When I run a gulp task for Zen I get

TypeError: $.if is not a function
    at Gulp.<anonymous> (/path/to/project/gulpfile.js:134:15)
    at module.exports (/path/to/project/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/path/to/project/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/path/to/project/node_modules/orchestrator/index.js:214:10)
    at /path/to/project/node_modules/orchestrator/index.js:279:18
    at finish (/path/to/project/node_modules/orchestrator/lib/runTask.js:21:8)
    at /path/to/project/node_modules/orchestrator/lib/runTask.js:43:4

for
line 134 in my gulpfile.js is
.pipe($.if(browserSync.active, browserSync.stream({match: '**/*.css'})));

Commenting out the line seems to disable automatically reloading the browser when a new styles.css is created.

Any ideas how to fix this would be very much appreciated. Thanks!

Comments

criscom created an issue. See original summary.

criscom’s picture

What I did was to uncomment line 134 and substitute it with

.pipe(browserSync.stream())

This does not throw any errows and also browserSync works fine.

Not sure what

.pipe($.if(browserSync.active, browserSync.stream({match: '**/*.css'})));

is for anyway.

JohnAlbin’s picture

Status: Active » Closed (cannot reproduce)

The $ is the gulp-load-plugins package and $.if is the the gulp-if package.

As long as you have both of those packages in your package.json file, the gulpfile.js should work fine.