Skip to content

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

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

Merged
merged 1 commit into from
Feb 12, 2018

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