Gulp: Object #<Readable> has no method 'write' Error -
i'm getting error when trying run gulp
command. worked fine last week. reason why i'm getting following error now?
typeerror: object #<readable> has no method 'write'
this js task looks like.
// js task gulp.task('js', function () { var browserified = transform(function(filename) { var b = browserify(filename); return b.bundle(); }); return gulp.src('./src/js/*.js') .pipe(browserified) .pipe(sourcemaps.init({loadmaps: true})) .pipe(uglify()) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('./build/js')) .pipe(reload({stream: true})) });
here's link entire gulpfile.js
: https://github.com/realph/gulp-zero/blob/master/gulpfile.js
any appreciated. in advance!
what version of browserify
have @ moment? browserify changed not accept inward streams, creating some. correct, adapted code:
var source = require('vinyl-source-stream'); var buffer = require('gulp-buffer'); gulp.task('js', function () { return browserify({entries:['./src/js/main.js']}) .bundle() .pipe(source('bundle.js')) .pipe(buffer()) .pipe(sourcemaps.init({loadmaps: true})) .pipe(uglify()) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('./build/js')) .pipe(reload({stream: true})) });
update changed filename
real file. note browserify works best if have 1 file there. if have create multiple bundles, please refer this article