9.0.6 breaks my gulp + watchify setup
See original GitHub issue@Gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var transform = require('vinyl-transform');
var debug = require('gulp-debug');
var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');
var _ = require('underscore');
var paths = {
src: './www/src/',
dist: './www/dist/'
};
var b = browserify(paths.src + 'js/', _.extend(watchify.args, {debug: true}));
var bundler = watchify(b)
.transform(reactify)
.on('update', bundle)
.on('log', console.error);
console.log(watchify.args);
function bundle() {
var bundle = transform(function(filename) {
return bundler.bundle();
});
return gulp.src([paths.src + 'js/index.js'])
.pipe(debug({title: 'bundle'}))
.pipe(bundle)
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
.pipe(gulp.dest(paths.dist));
}
gulp.task('browserify', bundle);
Upgrading to 9.0.6 results in the following error:
_stream_readable.js:540
var ret = dest.write(chunk);
^
TypeError: undefined is not a function
at Producer.ondata (_stream_readable.js:540:20)
at Producer.emit (events.js:107:17)
at Producer.Readable.read (_stream_readable.js:373:10)
at flow (_stream_readable.js:750:26)
at resume_ (_stream_readable.js:730:3)
at _stream_readable.js:717:7
at process._tickCallback (node.js:355:11)
9.0.4 works fine
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Version 8.0.2 broke my build with gulp · Issue #1044 - GitHub
Just a quick note that our build scripts have been broken by this issue too, and we've also had to downgrade ... 9.0.6...
Read more >Gulp with watchify/browserify runs twice then stops watching
It turned out PHPStorm / System Settings / Use "safe write", if enabled, stops watchify after PHPStorm edits the file.
Read more >Using Watchify with Gulp for fast Browserify build
I thought I would be able to .pipe(uglify()) in bundleShare() .. but it breaks. Do i need to use vinyl-transform to enable this?...
Read more >gulp-browserify-watchify-glob - npm
Create a Browserify bundler with multiple entries based on a glob pattern. Rebuild incrementally watching for changes, including additions ...
Read more >Gulpfile Setup-Automate and Enhance Your Code - YouTube
Ever wondered how other developers minify their code and add tons of enhancements to their projects or apps? I can tell you a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Am I reading this wrong? It seems the objective is to produce multiple bundles and your fix is to make a single bundle.
b.bundle() has always been documented* as returning a readable stream. From version to version, sometimes a duplex stream would be returned as an implementation detail, but writing to it was always undefined behavior.
If you must use gulp for this task, use
vinyl-source-stream
instead ofvinyl-transform
.*Effectively always, starting with version 2.