exception: browserify + vinyl-transform
See original GitHub issueHi,
It’s my gulpfile.js setting.
//gulpfile.js
var gulp = require("gulp");
var browserify = require("browserify");
var transform = require("vinyl-transform");
var rename = require("gulp-rename");
gulp.task("scripts", function () {
var browserified = transform(function (filename) {
var b = browserify(filename);
return b.bundle();
});
return gulp.src([
"./test/myApp/_module.js"
])
.pipe(browserified)
.pipe(rename("app.js"))
.pipe(gulp.dest("./test/"));
});
When I use latest version of browserify, this exception are as follows.
_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)
Process terminated with code 1.
However, I downgrade to v9.0.4, anything will be ok. Who can talk me how to fix it ?
thanks
Issue Analytics
- State:
- Created 8 years ago
- Comments:12
Top Results From Across the Web
task-browserify@0.0.1 vulnerabilities - Snyk
Learn more about task-browserify@0.0.1 vulnerabilities. task-browserify@0.0.1 has 20 known vulnerabilities found in 48 vulnerable paths.
Read more >gulp + browserify, the gulp-y way | by Hafiz Ismail - wehavefaces
We only need vinyl-transform to make this all work, which is still a useful library for your other gulp needs. Using gulp-browserify. var...
Read more >Browserify building with dependencies that have require ...
I'm trying to use timbre.js (npm version) with Browserify, but it has require statements for optional dependencies in a try statement (see ...
Read more >Development and Such — Gulp, Browserify, and Source Maps
Gulp, Browserify, and Source Maps The worst thing about Browserify is the need for source ... This warning and the subsequent exception:
Read more >Open Source Disclosure — Cloudvue Video Surveillance and ...
Babel browserify transform ... vinyl-transform ... However, as a special exception, the source code distributed need not include anything that is normally ...
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
HI Bibby,
there seem to be a couple of other issues raised around this topic.
Paraphrasing here but, browserify’s bundle() is documented as returning readable stream whereas vinyl-transform expects a transform/duplex stream which is readable and writeable. This worked in the past as .bundle() was at times returning a duplex stream however this is now fixed in line with the docs.
I’m currently using ‘through2’ and something akin to the following
which was taken from aymanrady on this thread which has a few other recipes for using browserify within gulp.
Hope that helps.
If someone is looking for an easy approach: check out our https://www.npmjs.com/package/gulp-browser package
It works with the latest browserify and bundles any “require” by default.