Crash with SyntaxError: Unexpected token C in JSON at position 1644
See original GitHub issueI saw a case very similar to https://github.com/microsoft/vscode-languageserver-node/issues/436
SyntaxError: Unexpected token C in JSON at position 1644
at JSON.parse (<anonymous>)
at StreamMessageReader.onData (node_modules/vscode-jsonrpc/lib/messageReader.js:182:29)
at Socket.listen.readable.on (node_modules/vscode-jsonrpc/lib/messageReader.js:148:18)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
It looks like with certain characters the Emacs lsp-mode LSP client sends a bogus request. I’ve entered an issue with them to improve the situation https://github.com/emacs-lsp/lsp-mode/issues/1246
That issue contains repro steps and shows how to repro the example using a fork of the lsp-sample language server integrated into Emacs.
Could this repo be updated to more gracefully handle what looks to be a bogus request? That would help so that language servers don’t get killed because of an issue in an LSP client.
Please let me know other info/debug output I can provide to help.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SyntaxError: Unexpected token < in JSON at position 0
The error seems to be called in an infinite loop presumably as React continuously tries to connect to the server and eventually crashes...
Read more >SyntaxError: Unexpected token T in JSON at position 0 - Drupal
Problem/Motivation When you try to launch a new site, this error fatal occurs: "SyntaxError: Unexpected token T in JSON at position 0"
Read more >2 Server Error Message Reference - MySQL :: Developer Zone
Message: Table '%s' is marked as crashed and should be repaired ... Message: Invalid JSON text: "%s" at position %u in value for...
Read more >Unexpected token in JSON at position 0 - YouTube
Uncaught (in promise) SyntaxError : Unexpected token in JSON at position 0.
Read more >Bug #15794: Can not start Puma with Rails after bundle install
Don't forget to include the above Crash Report log file in bug reports. ... /Users/bacdo/.rvm/gems/ruby-2.4.3/gems/psych-3.1.0/lib/psych/json/ruby_events.rb ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The response has a wrong Content-Length set. This is why you end up with the additional “C”. It basically belongs to the header of the next message.
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!