Skip to content

Fix for -- SyntaxError: Unexpected end of input #5

Open
@payousefi

Description

@payousefi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions