Skip to content
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

Unable to debug web apps using latest Flutter master / SDK DAPs #4413

Closed
DanTup opened this issue Mar 1, 2023 · 7 comments
Closed

Unable to debug web apps using latest Flutter master / SDK DAPs #4413

DanTup opened this issue Mar 1, 2023 · 7 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps in web Relates to running Dart or Flutter web apps is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Mar 1, 2023

When clicking the Dart Debug Extension button (edit: this happens on Chrome too, not specific to the debug extension), the connection is made but the app never loads.

Verbose logs contain this:

Connecting to VM Service at ws://127.0.0.1:54237/nxSUombw4hc=/ws
[ +107 ms] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 16, error: {code: -32601, message: Method not found, data: {jsonrpc: 2.0, method: _setStreamIncludePrivateMembers, id: 16, params: {streamId: Isolate, includePrivateMembers: false}}}}
[        ] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 17, error: {code: -32601, message: Method not found, data: {jsonrpc: 2.0, method: _setStreamIncludePrivateMembers, id: 17, params: {streamId: Debug, includePrivateMembers: false}}}}
[        ] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 18, error: {code: -32601, message: Method not found, data: {jsonrpc: 2.0, method: _setStreamIncludePrivateMembers, id: 18, params: {streamId: Logging, includePrivateMembers: false}}}}
[        ] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 19, error: {code: -32601, message: Method not found, data: {jsonrpc: 2.0, method: _setStreamIncludePrivateMembers, id: 19, params: {streamId: Extension, includePrivateMembers: false}}}}
[        ] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 21, error: {code: -32601, message: The stream `ToolEvent` is not supported on web devices}}
[  +51 ms] ExpressionEvaluator: Evaluating "() => true" at packages/flutter/src/widgets/title.dart
[  +34 ms] ExpressionEvaluator: Evaluated "() => true" to "boolean true" for isolate 1

It's unclear which (if any) of these are causing the issue.

@DanTup DanTup added is bug in web Relates to running Dart or Flutter web apps in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session labels Mar 1, 2023
@DanTup DanTup added this to the v3.62.0 milestone Mar 1, 2023
@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

@elliette FYI - this may affect today's testing. I did a release of Dart-Code today that re-enabled the SDK DAPs for users on latest master of Flutter.

An immediate workaround is to disable SDK DAPs with this VS Code setting:

"dart.previewSdkDaps": false,

Depending on the cause (and how quick a fix will arrive in the SDK) we may need to hot-fix Dart-Code to bump using the SDK DAPs further back (or at least do so in a pre-release version and users of Flutter master can use that).

(I'm looking into it and will post my findings shortly)

@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

{jsonrpc: 2.0, id: 21, error: {code: -32601, message: The stream `ToolEvent` is not supported on web devices}}

This is the issue. Removing the code that tries to listen on this stream fixes the issue. I'm going to temporarily revert change to enable SDK DAPs in a pre-release version of the extension (so people testing have an option) but I'll hang fire on pushing out a stable release unless it's clear we can't fix this in Flutter master fairly quickly.

@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

Edit: moved to #4414 (comment)

@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

I originally thought this was only affecting the Dart Debug extension, but it's affecting Chrome too. I'm going to push a stable Dart-Code to delay enabling the SDK DAPs (Dart 3 pre-releases might mean more people on pre-releases) to resolve this, and have opened #4414 to track the proper fix.

DanTup added a commit that referenced this issue Mar 1, 2023
This hotfix reverts #4314 because of  #4413.
@DanTup DanTup modified the milestones: v3.62.0, v3.60.1 Mar 1, 2023
@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

Fixed (by not enabling SDK DAPs by default for current Flutter pre-release) in v3.60.1 of the Dart extension.

@DanTup DanTup closed this as completed Mar 1, 2023
@elliette
Copy link

elliette commented Mar 1, 2023

Thanks for the quick fix! Is there anything I should keep an eye out for?

@DanTup
Copy link
Member Author

DanTup commented Mar 1, 2023

@elliette I don't think so. As long as you're on the latest Dart extension (3.60.1 stable, 3.61.20230302 pre-release) or previous versions from before today (3.58/3.59) and you haven't set "dart.previewSdkDaps": true explicitly, you'll be on the legacy DAPs which don't trigger this issue (and hopefully everything just works).

Of course, if you do spot any issues that may be VS Code/extension related, let me know.

It's unfortunate I didn't pick this up sooner - it would've been good if today's testing could've been done with the new DAPs (since the sooner we find any remaining issues, the better), but it is what it is.

I'll re-enable the new DAPs with a new Flutter version number as soon as we have a fix and it gets into Flutter, so any future testing can hopefully be on that (I'm really keen to find any show-stoppers before the next stable branch so we can finally get stable users over to it 😄).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps in web Relates to running Dart or Flutter web apps is bug
Projects
None yet
Development

No branches or pull requests

2 participants