Skip to content

Fix for issue 'unexpected end of input' error in call function by JSON.parse#6

Merged
joshkatz merged 1 commit intojoshkatz:masterfrom
payousefi:master
Feb 12, 2018
Merged

Fix for issue 'unexpected end of input' error in call function by JSON.parse#6
joshkatz merged 1 commit intojoshkatz:masterfrom
payousefi:master

Conversation

@payousefi
Copy link
Contributor

Referenced in issue #5

…arse'd causing error

Concat data as chunks, callback on ‘close’ instead
prasad83 added a commit to prasad83/r-script that referenced this pull request Mar 15, 2017
When stderr and stdout gets data callback function get invoked twice. Devised following fix along with joshkatz#6
@patrickcze
Copy link

This is an important bug fix that should be accepted as it resolves an issue with async calls

@andru
Copy link

andru commented Feb 12, 2018

Async is very broken without this fix. I'm currently using payousefi's fork in production code. @joshkatz please merge this.

@joshkatz joshkatz merged commit 1767ec2 into joshkatz:master Feb 12, 2018
@andru
Copy link

andru commented Feb 12, 2018

🙌🏼

@ccornchip
Copy link

ccornchip commented Dec 4, 2020

Unfortunately, this causes an a fatal error when R encounters an exception:

body === "" as nothing is in stdout (it all goes to stderr)
then when the callback child.on('close', ...) is called, it causes an 'unexpected end of input' error in function by JSON.parse

I think this can be fixed by #7

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

Successfully merging this pull request may close these issues.

6 participants