JamieMason / ImageOptim-CLI

Make optimisation of images part of your automated build process
https://foldleft.io/image-tools
MIT License
3.44k stars 124 forks source link

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded #205

Open grzegorzkrukowski opened 3 months ago

grzegorzkrukowski commented 3 months ago

Steps To Reproduce The Error

Expected Behaviour

Images should be optimised without an error

Actual Behaviour

Error is thrown

! stderr maxBuffer length exceeded

! Please raise an issue at https://github.com/JamieMason/ImageOptim-CLI/issues

    RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded
        at new NodeError (node:internal/errors:388:5)
        at Socket.onChildStderr (node:child_process:476:14)
        at Socket.emit (node:events:537:28)
        at addChunk (node:internal/streams/readable:324:12)
        at readableAddChunk (node:internal/streams/readable:293:11)
        at Readable.push (node:internal/streams/readable:234:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Version Numbers or N/A

troyxmccall commented 1 month ago

@grzegorzkrukowski I've addressed this issue in this PR

https://github.com/JamieMason/ImageOptim-CLI/pull/200

until it is merged, you can

git clone https://github.com/troyxmccall/ImageOptim-CLI -b  batch-size-option
cd ImageOptim-CLI
yarn && yarn build

to build the binary with batch-size options

then, in that same ImageOptim-CLI dir you can run

./dist/imageoptim --batch-size=5 /full/path/to/your/folder