Skip to content
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

stdout maxBuffer length exceeded (diff.js) #192

Closed
Pavel311 opened this issue Feb 6, 2019 · 1 comment
Closed

stdout maxBuffer length exceeded (diff.js) #192

Pavel311 opened this issue Feb 6, 2019 · 1 comment

Comments

@Pavel311
Copy link

Pavel311 commented Feb 6, 2019

I ran into a error while comparing two branches with large amount of changes.

events.js:174
      throw er; // Unhandled 'error' event
      ^

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (child_process.js:348:14)
    at Socket.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:261:13)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:94:17)
Emitted 'error' event at:
    at /home/user/git/projectname/node_modules/gulp-git/lib/diff.js:87:31
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:600:12)

I found similar problem with solution issue#68.

In diff.js:86 I changed

exec('git diff --raw -z ' + cmd, {cwd: opt.cwd}, function(err, stdout) {

to

exec('git diff --raw -z ' + cmd, {cwd: opt.cwd, maxBuffer: Infinity}, function(err, stdout) {

Now everything works.

@stephenlacy
Copy link
Owner

Added option to pass it in, thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants