lsp-dart icon indicating copy to clipboard operation
lsp-dart copied to clipboard

JSON parse error when running dap-debug

Open siraben opened this issue 4 years ago • 12 comments

Describe the bug I'm unable to start a debug session with dap-mode, after running M-x dap-debug I get the following message.

error in process filter: End of file while parsing JSON: "premature end of input", "<string>", 1, 1024, 1024 [2 times]

To Reproduce M-x dap-debug

Version

[LSP Dart] 1.17.11 (package: 20201206.1725) at 2021.01.08 @ Emacs 28.0.50
[Dart SDK] Dart SDK version: 2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "macos_x64"

siraben avatar Jan 08 '21 13:01 siraben

@siraben did you run dap-dart-setup before?

ericdallo avatar Jan 08 '21 14:01 ericdallo

@ericdallo yes.

siraben avatar Jan 08 '21 14:01 siraben

It was working before but has stopped working, not sure why.

siraben avatar Jan 08 '21 14:01 siraben

Ok, maybe some flutter/dart update broke that, could you M-x toggle-debug-on-error and reproduce the issue again, then paste the stacktrace here?

ericdallo avatar Jan 08 '21 14:01 ericdallo

Weird, I ran M-x toggle-debug-on-error then M-x dap-debug, but no stacktrace was produced.

siraben avatar Jan 08 '21 14:01 siraben

Probably because is not a elisp raw error, it's from parsing the json on dap buffer, @yyoncho do you know how to debug that?

ericdallo avatar Jan 08 '21 14:01 ericdallo

Might be similar to https://github.com/emacs-lsp/lsp-mode/issues/2375 What you can do is to wrap the debugger and see what exactly it is receiving.

yyoncho avatar Jan 08 '21 21:01 yyoncho

Might be similar to https://github.com/emacs-lsp/lsp-mode/issues/2375 What you can do is to wrap the debugger and see what exactly it is receiving.

How would I wrap the debugger?

siraben avatar Jan 09 '21 06:01 siraben

Did you ever get anywhere with this @siraben? I'm seeing the same error and am also not clear on how to wrap the debugger as @yyoncho suggests.

zheylmun avatar Jan 05 '22 02:01 zheylmun

@zheylmun I have not programmed in Dart for a while so haven't tested the issue.

siraben avatar Jan 05 '22 03:01 siraben

Could you both test with latest lsp-dart released this week and confirm this is still happening?

ericdallo avatar Jan 05 '22 12:01 ericdallo

Might be similar to what I reported here - https://github.com/emacs-lsp/lsp-dart/issues/163#issuecomment-1169519435

jvliwanag avatar Jun 29 '22 04:06 jvliwanag

This should be fixed after https://github.com/emacs-lsp/lsp-dart/pull/165

ericdallo avatar Oct 31 '22 00:10 ericdallo