-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node v4.2.1 throws error when using gulp-header #23
Comments
Same here but for me the problem seems to only occur when using submodules as tasks (via 'require-dir') - but not 100% sure... |
@marcobarbosa does it still do this if you use Not sure why it would start with 4.2.1, I know there were some changes to Buffer to now be backed by UInt8Array or some such... |
Same issue but it does work when wrapped in |
Plugins should come from a package named something with autoload-plugins which I also use. Rest assured that it is not causing this problem. Header used to work for me at least until last week and the only significant change was restructuring my tasks into separate files and require them from subdirectories via requireDir... |
@alex7kom in my case streamify does not solve the problem, how did you exactly do it? |
OK, in my case the solution was quite simple @alex7kom @marcobarbosa: I omitted the file extension in my watch task using only |
@marcobarbosa @alex7kom Could either of you create a simple github project that demonstrates the error in question? I'm unable to recreate, and it seems it was a misconfiguration for dueth ... Leaving open for now, may look farther into it as time permits. |
As an additional clue, in my particular case I was able to work around the problem by using // ...
, browserify = require('browserify')
, source = require('vinyl-source-stream')
, buffer = require('vinyl-buffer')
, sourcemaps = require('gulp-sourcemaps')
, watchify = require('watchify')
, header = require('gulp-header')
// ...
function Browserify() {
var b = browserify(opts);
if (watch) {
b = watchify(b)
.on('update', function () {
bundle(b);
});
}
b
.transform(babelify.configure({
// Make sure to change in test_compiler.js too
optional: ['es7.classProperties']
}))
.on('log', gutil.log)
;
return bundle(b);
}
function bundle(b) {
return b.bundle()
.on('error', function (error) {
gutil.log(
gutil.colors.cyan('Browserify') + gutil.colors.red(' found unhandled error:\n'),
error.toString()
);
this.emit('end');
})
.pipe(source('main.js'))
.pipe(buffer()) // <--
.pipe(header('/* ' + buildHeader() + ' */'))
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('dist/js'))
.pipe(size({
showFiles: true
}))
.pipe(size({
showFiles: true,
gzip: true
}));
} |
Note to self, maybe try vinyl-buffer at the beginning? @WesCossick thanks, will try to take a look tomorrow evening. |
Sorry for never replying this guys. Thanks a lot for the interesting discussion! @tracker1 Despite the Node update I've also updated all of the used libs to the latest (browserify, babelify, gulp, etc). EDIT: Not sure if I or you should close it? It'd be good to get another confirmation :) EDIT2: Just realised that having
|
Same problem in JsSIP when calling gulp.task('browserify', function() {
return browserify([path.join(__dirname, PKG.main)], {
standalone: PKG.title
}).bundle()
.pipe(vinyl_source_stream(PKG.name + '.js'))
.pipe(header(BANNER, BANNER_OPTIONS))
.pipe(gulp.dest('dist/'));
}); And yes, calling |
After updating packages the gulp build task stopped working. The gulp-header was the culprit (details at gulp-community/gulp-header#23). Changed from gulp-streamify to gulp-buffer and alls good
published patch |
How I'm using it (shortened for readability):
Commenting out the
plugins.header
line and the build works again.Any ideas?
The text was updated successfully, but these errors were encountered: