-
Notifications
You must be signed in to change notification settings - Fork 24
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
Error when expanding local variable with Flutter Web #187
Comments
Looks like that exception comes from the DAP debugger server, any thoughts @DanTup? |
Based on the call stack and the code snippet (which seems to be coming from https://github.com/dart-lang/webdev/blob/84e197e2d75809281686b98e7507fb08b46fd18d/dwds/lib/src/debugging/classes.dart) I think the error is occurring in DWDS (which implements a Dart VM Service protocol over JavaScript/Chrome for debugging web apps). I would suggest filing an issue with these details at https://github.com/dart-lang/webdev (which is the repo for DWDS), although it's curious that this doesn't occur in VS Code. It's possible that you're using the old legacy DAPs in VS Code and maybe they behave slightly differently? You can force the new SDK DAPs in VS Code by adding |
Just to be clear, I haven't personally tried on VSCode, but I have asked colleagues if it worked. I could try to install VSCode myself and try it (I'm not using it normally, I'm using IntelliJ mostly) |
IntelliJ should generally behave the same here too. The DAP used by VS Code (and emacs here) is just wrapping the VM Service which IntelliJ also uses. It's very possible (even likely) there are some differences in how it fetches and renders data for variables, although something like this seems like it should show up in both. If you're able to build a small repro you can share that triggers the issue I'm happy to take a look too. A full DAP traffic log would be useful too (using the same sharable repro), in case I can't reproduce it myself. |
There you go https://github.com/Pacane/lsp_repro Just a bit of context for the app (tried to replicate as much of what I'm doing in my real project). It's the regular counter app, but with a bloc to hold a value state. The state and events of the bloc are actual Freezed classes (events are union types and state is a freezed immutable object). There's a bloc builder in the main app that renders a Text widget with the value held in the bloc. If you add a breakpoint on the line 79 (return line), and expand bloc -> _state in the dap UI locals, you do get the error I posted earlier.
Hopefully that'll help! |
I do see the same issue in VS Code:
The line/col in the errr at the top of the stack looks like this: Unfortunately I'm not sure how to attach a JS debugger to the expressions being evaluated by DWDS here. My feeling is that there's a DWDS bug here - even if the trigger is an exception in user code, it doesn't seem like it should be failing in this way. Given you have a good repro, I would suggest filing an issue at https://github.com/dart-lang/webdev with the repro steps above (you can link back here for some additional context, and feel free to CC me in case I can add any value). |
Describe the bug
When expanding a local variable (not happening with all variables), in the DAP ui mode, I get an exception.
For reference, I tried expanding the variable
searchState
in my case. And for more context, I'm able to inspect such variables in IntelliJ and VSCode.To Reproduce
I'm using a closed source project, but what I'm doing specifically is trying to expand a variable that's passed as a closure, which has for type a Freezed union type value.
Expected behavior
It would expand the thing normally.
Screenshots
Version
Include here the result of: M-x
lsp-dart-version
Here's the actual stacktrace
The text was updated successfully, but these errors were encountered: