Node v4.2.1 throws error when using gulp-header
See original GitHub issuebuffer.js:167
throw new TypeError('must start with number, buffer, array or string');
^
TypeError: must start with number, buffer, array or string
at fromObject (buffer.js:167:9)
at new Buffer (buffer.js:58:10)
at Concat.add (/.../node_modules/gulp-header/node_modules/concat-with-sourcemaps/index.js:40:15)
at DestroyableTransform.TransformStream [as _transform] (/.../node_modules/gulp-header/index.js:49:12)
at DestroyableTransform.Transform._read (/.../node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:10)
at DestroyableTransform.Transform._write (/.../node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:160:12)
at doWrite (/.../node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:326:12)
at writeOrBuffer (/.../node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:312:5)
at DestroyableTransform.Writable.write (/.../node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:239:11)
at write (/.../node_modules/vinyl-source-stream/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
How I’m using it (shortened for readability):
// Create banner for Main JS file
var javascriptBanner = ['/**',
' * This is the main js file',
' * Edited: <%= new Date() %>',
' */',
'',
'console.log("Time since you changed main.js: " + ((new Date().getTime() - <%= new Date().getTime() %> ) / 1000) + "s");',
'',
''].join('\n');
module.exports = function(gulp, plugins, config, browserSync) {
return function() {
browserify({
entries: [
// ...
]
})
.transform()
.transform()
.bundle()
.pipe(source(config.jsOutputFilename))
.pipe(plugins.header(javascriptBanner))
.pipe(gulp.dest(config.outputJsDir))
.pipe(browserSync.stream())
};
};
Commenting out the plugins.header
line and the build works again.
Any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Problem with package.json? · Issue #2524 - GitHub
I have install node 5.9.1 cleanly and gotten almost same result with 'npm install'. However I cannot build Mattermost. ERROR in ./~/css-loader ...
Read more >node.js - Installing puppeteer throws error with "Failed to ...
Failed at the puppeteer@4.0.1 install script 'node install.js'. npm ERR! Make sure you have the latest version of node.js and npm installed.
Read more >Problems with rfbrowser init - Browser - Robot Framework
I have try installation at company network and I have problems with grpc > grpc@1.24.3 install ...
Read more >Node v4.2.1 (LTS)
When a server queues a large amount of data to send to a client over a pipelined HTTP connection, the underlying socket may...
Read more >How to Throw Exceptions in Node.js - Rollbar
Node.js Throw Exception; How do you protect your application against exceptions? Wrapping Up; Track, Analyze and Manage Errors With Rollbar.
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
As an additional clue, in my particular case I was able to work around the problem by using
vinyl-buffer
before and not aftergulp-header
:published patch