-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
JSON Parse error in internal/process/report
?
#43193
Comments
Just a shot in the dark. But it looks like the function Though this looks like an error thrown by JS. This function https://github.com/nodejs/node/blob/master/lib/internal/process/report.js#L32 seems to also deal with the report generation. What if you add a few console logs there to see if that's where it is happening? |
I'll give that a try and report back; thanks for the suggestion! |
Big thanks to @JckXia for helping me track this down. It seems that this error happens when the vertical tab byte Weird that other binary bytes seem to be escaped appropriately. That said, the problem is now reproducible. Being sure to use the binary byte (not characters % FOO='^K'
% node
> process.report.getReport();
Uncaught SyntaxError: Unexpected token v in JSON at position 10157 |
@nodejs/diagnostics |
@wrynegade I have a maybe silly question, could you share how to type binary byte (not characters ^ and K)? I am on mac. |
Of course! I don't have a macbook to test specifically, but this is the byte sent by pressing CTRL + K. Typing this character as a byte literal will depend largely on your editor and system. In a terminal emulator you can type CTRL + V (to insert the next character sequence as a literal) then CTRL + K. |
Thank you! I made it. I could reproduce this problem now. |
PR-URL: nodejs/node#43206 Fixes: nodejs/node#43193 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Version
Platform
Subsystem
process.report.getReport
What steps will reproduce the bug?
1 Step: Run
process.report.getReport()
How often does it reproduce? Is there a required condition?
I can only reproduce this on the current machine. Two other machines on the same architecture and node version appear unaffected.
Full reinstall of
node
had no effect.What is the expected behavior?
No response
What do you see instead?
Additional information
I looked through source and don't understand how this report is generated, so I don't know how to debug.
This prevents me from building a variety of node projects on this machine and only started after an upgrade from v17.
The text was updated successfully, but these errors were encountered: