{"action":"opened","issue":{"url":"https://api.github.com/repos/OverZealous/lazypipe/issues/24","repository_url":"https://api.github.com/repos/OverZealous/lazypipe","labels_url":"https://api.github.com/repos/OverZealous/lazypipe/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/OverZealous/lazypipe/issues/24/comments","events_url":"https://api.github.com/repos/OverZealous/lazypipe/issues/24/events","html_url":"https://github.com/OverZealous/lazypipe/issues/24","id":146060088,"number":24,"title":"strange TypeError: dest.on is not a function with lazypipe","user":{"login":"asiniy","id":1296472,"avatar_url":"https://avatars.githubusercontent.com/u/1296472?v=3","gravatar_id":"","url":"https://api.github.com/users/asiniy","html_url":"https://github.com/asiniy","followers_url":"https://api.github.com/users/asiniy/followers","following_url":"https://api.github.com/users/asiniy/following{/other_user}","gists_url":"https://api.github.com/users/asiniy/gists{/gist_id}","starred_url":"https://api.github.com/users/asiniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asiniy/subscriptions","organizations_url":"https://api.github.com/users/asiniy/orgs","repos_url":"https://api.github.com/users/asiniy/repos","events_url":"https://api.github.com/users/asiniy/events{/privacy}","received_events_url":"https://api.github.com/users/asiniy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-05T17:46:24Z","updated_at":"2016-04-05T17:46:24Z","closed_at":null,"body":"Hello @OverZealous I'm using `lazypipe()` as template to DRY my gulp tasks.\r\n\r\nUnfortunately, I get an error:\r\n\r\n```\r\nserge@serge:~/projects/haystak$ gulp deploy\r\n[20:41:50] Starting 'deploy'...\r\nBuilding APP bundle\r\n[20:41:50] 'deploy' errored after 25 ms\r\n[20:41:50] TypeError: dest.on is not a function\r\n    at Duplexer.Readable.pipe (/home/serge/projects/korob/node_modules/readable-stream/lib/_stream_readable.js:485:8)\r\n    at rebundle (/home/serge/projects/korob/Gulpfile.js:69:8)\r\n    at browserifyTask (/home/serge/projects/korob/Gulpfile.js:82:3)\r\n    at Gulp.<anonymous> (/home/serge/projects/korob/Gulpfile.js:229:3)\r\n    at module.exports (/home/serge/projects/korob/node_modules/orchestrator/lib/runTask.js:34:7)\r\n    at Gulp.Orchestrator._runTask (/home/serge/projects/korob/node_modules/orchestrator/index.js:273:3)\r\n    at Gulp.Orchestrator._runStep (/home/serge/projects/korob/node_modules/orchestrator/index.js:214:10)\r\n    at /home/serge/projects/korob/node_modules/orchestrator/index.js:279:18\r\n    at finish (/home/serge/projects/korob/node_modules/orchestrator/lib/runTask.js:21:8)\r\n    at cb (/home/serge/projects/korob/node_modules/orchestrator/lib/runTask.js:29:3)\r\n\r\n```\r\n\r\nmy gulpfile (I removed unnecessary lines out of scope + plus add references to lines):\r\n\r\n``` javascript\r\nvar browserify  = require('browserify');\r\nvar babelify    = require('babelify');\r\nvar pathmodify  = require('pathmodify');\r\nvar path        = require('path');\r\nvar concat      = require('gulp-concat');\r\nvar cssmin      = require('gulp-cssmin');\r\nvar glob        = require('glob');\r\nvar gulp        = require('gulp');\r\nvar gulpif      = require('gulp-if');\r\nvar gutil       = require('gulp-util');\r\nvar rev         = require('gulp-rev');\r\nvar revReplace  = require('gulp-rev-replace');\r\nvar buffer      = require('gulp-buffer');\r\nvar insertLines = require('gulp-insert-lines');\r\nvar livereload  = require('gulp-livereload');\r\nvar htmlmin     = require('gulp-htmlmin');\r\nvar notify      = require('gulp-notify');\r\nvar sass        = require('gulp-ruby-sass');\r\nvar shell       = require('gulp-shell');\r\nvar slim        = require('gulp-slim');\r\nvar source      = require('vinyl-source-stream');\r\nvar streamify   = require('gulp-streamify');\r\nvar uglify      = require('gulp-uglify');\r\nvar watchify    = require('watchify');\r\n\r\nvar lazypipe = require('lazypipe');\r\n// Add md5 hashsums to assets\r\nfunction revFiles(dest) {\r\n  return lazypipe()\r\n    .pipe(gulp.dest, dest);\r\n}\r\n\r\nvar browserifyTask = function (options) {\r\n  // Our app bundler\r\n  var appBundler = browserify({\r\n    entries: [options.src], // Only need initial file, browserify finds the rest\r\n    debug: options.development, // Gives us sourcemapping\r\n    cache: {}, packageCache: {}, fullPaths: options.development // Requirement of watchify\r\n  })\r\n    .plugin(pathmodify, {\r\n      mods: [\r\n        pathmodify.mod.dir('npm', path.join(__dirname, 'node_modules'))\r\n      ]\r\n    })\r\n    .transform(babelify, { presets: ['react', 'es2015'] })\r\n\r\n  // The rebundle process\r\n  var rebundle = function () {\r\n    var start = Date.now();\r\n    console.log('Building APP bundle');\r\n    appBundler.bundle()\r\n      .on('error', gutil.log)\r\n      .pipe(source('application.js'))\r\n      .pipe(gulpif(!options.development, streamify(uglify())))\r\n      .pipe(revFiles(options.dest)) // line 69\r\n      .pipe(notify(function () {\r\n        console.log('APP bundle built in ' + (Date.now() - start) + 'ms');\r\n      }))\r\n      .on(\"finish\", function() { refreshView(options) });\r\n  };\r\n\r\n  // Fire up Watchify when developing\r\n  if (options.development) {\r\n    appBundler = watchify(appBundler);\r\n    appBundler.on('update', rebundle);\r\n  }\r\n\r\n  rebundle(); // line 82\r\n}\r\n\r\ngulp.task('deploy', function () {\r\n  browserifyTask({ // line 229\r\n    development: false,\r\n    src: './app/coffee/application.js',\r\n    dest: './public/dist/'\r\n  });\r\n});\r\n```\r\nI'll be appreciated by your help"}}