-
Notifications
You must be signed in to change notification settings - Fork 75
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 while inspecting variable in flutter web. #1814
Comments
@jacob314 – can you help route? I don't think this has to do w/ pkg:webdev |
The thrown error starts with "Unexpected error from chrome devtools" so my feeling was that this might be something not being handled correctly in DWDS (although I also couldn't find the code trying to read Usually when an expression evaluation fails, there's an exception returned from the
|
I'm able to reproduce this when debugging from VSCode, but not when debugging with Flutter DevTools (expanding It looks like the error is coming from here: webdev/dwds/lib/src/debugging/inspector.dart Line 392 in 3e2364e
objectId seems strange to me:
@DanTup, is there a way to specify the Flutter SDK in VSCode to be my local Flutter to help debug? Thanks! |
@elliette you can use the |
Following the repro steps, I was able to expand the state variable without any crashes in both VSCode, Dart Devtools, and Chrome Devtools so this issue seems to have been fixed. Closing this bug. |
I've reported an exception I've gotten while using emacs with lsp-dart here.
Turns out @DanTup was able to reproduce it with my repro project using VSCode. He directed me here to open an issue as it seems to be an issue a bit deeper than just the lsp plugin I'm using. I'll try to describe as best as possible was was discussed in the other issue here.
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
@DanTup asked for repro steps and gave some context:
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.
Then I posted my repro steps
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.
Then , @DanTup replied
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).
The text was updated successfully, but these errors were encountered: