Hi -- not sure if this is still being managed, but I ran into this error and have a fix for it that might help others.
I was running a couple different R scripts that took a little longer to complete. I would receive an Unexpected end of input error, and the log of the actual data was a .
I concluded I was receiving the 'unexpected end of input' error because JSON.parse couldn't parse the string buffer being passed in from the data received from R via Node's child_process.spawn -- so I attempted concatenating the chunks of the data and then running the callback on close instead, and that fixed my issue!
It's possible I was receiving this error for another reason (and if anyone has other ideas, that would be useful), but I'll make a pull request referencing this issue in case it's something you think would be required for others.
Hi -- not sure if this is still being managed, but I ran into this error and have a fix for it that might help others.
I was running a couple different R scripts that took a little longer to complete. I would receive an Unexpected end of input error, and the log of the actual data was a.
I concluded I was receiving the 'unexpected end of input' error because JSON.parse couldn't parse the string buffer being passed in from the data received from R via Node's
child_process.spawn
-- so I attempted concatenating the chunks of the data and then running the callback onclose
instead, and that fixed my issue!It's possible I was receiving this error for another reason (and if anyone has other ideas, that would be useful), but I'll make a pull request referencing this issue in case it's something you think would be required for others.