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

Debugger stuck on waiting for connection from debug service on chrome when trying to run on web using Flutter 2.x #4370

Closed
felipefranca824 opened this issue Jan 31, 2023 · 14 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session is bug
Milestone

Comments

@felipefranca824
Copy link

Describe the bug
Debugger stuck on waiting for connection from debug service on chrome when trying to run on web

To Reproduce
Steps to reproduce the behavior:

  1. having a flutter project with an older version 2.10.5 for example
  2. click on debug
    image

Expected behavior
project was supposed to run normally

Screenshots
image

Please complete the following information:

  • Operating System and version: Ubuntu 22.04.1 LTS
  • VS Code version: 1.74.3
  • Dart extension version: 3.58.0
  • Dart/Flutter SDK version: 2.16.2/2.10.5
  • Target device (if the issue relates to Flutter debugging): chrome
@DanTup
Copy link
Member

DanTup commented Feb 1, 2023

@felipefranca824 from the error in your screenshot, it looks like there is a problem with the code (trying to use ?? after a non-nullable variable).

Does fixing that issue resolved the problem?

If not, can you produce a small sample project that triggers this issue that you can share? Thanks!

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Feb 1, 2023
@felipefranca824
Copy link
Author

felipefranca824 commented Feb 2, 2023

@DanTup
Reproduced in a new project
image
doesn't come out of it.

but if i run by command line "fllutter run -d chome" it works

@DanTup
Copy link
Member

DanTup commented Feb 2, 2023

@felipefranca824 can you reproduce this reliably?

Did you make any changes to the sample project, or run it as is (and how did you start it?).

Could you try capturing debugging logs while reproducing it (using the sample project)?

  • Run the Dart: Capture Debugging Logs command
  • Run the project to reproduce the issue
  • Wait at least 30s after Chrome appears, just to ensure the log isn't cut short of anything that might be running slowly
  • Click Cancel on the logging notification to stop logging and open the log
  • Remove anything sensitive from the log
  • Attach the log here, in a gist, or email to me at logs@dartcode.org.

Thanks!

@felipefranca824
Copy link
Author

@DanTup
I ran the project without any modifications.

I sent the log file to your email

@DanTup
Copy link
Member

DanTup commented Feb 2, 2023

@felipefranca824 thanks! I found the issue in your log:

setIsolatePauseMode: NoSuchMethodError: Class 'ChromeProxyService' has no instance method 'setIsolatePauseMode' with matching arguments.
Receiver: Instance of 'ChromeProxyService'
Tried calling: setIsolatePauseMode(\"1\", exceptionPauseMode: \"Unhandled\", shouldPauseOnExit: null)
Found: setIsolatePauseMode(String, {String exceptionPauseMode, bool shouldPauseOnExit}) => Future<Success>

This was a bug in earlier versions of Flutter (dart-lang/webdev#1627). It's since been fixed but you'll need to upgrade Flutter to a more recent version to get the fix (the current version is 3.7).

The reason it works from the command line is that this doesn't set up the debugger, which avoids the code that is failing.

Please let me know if you still have the issue after upgrading!

@felipefranca824
Copy link
Author

felipefranca824 commented Feb 2, 2023

After updating the problem was solved.

to continue using in older versions of flutter I used version 3.56.0 of the dartcode extension.

thanks

@DanTup
Copy link
Member

DanTup commented Feb 7, 2023

to continue using in older versions of flutter I used version 3.56.0 of the dartcode extension.

Oh, I see what's happened here. The new version of the extension is using a new version of the API, but there's a mismatch between the VM Service version that supports this in DWDS (web) versus the standard VM.

This is unfortunate, although since the latest stable versions of everything are working (and using the previous extension works around the issue) I think it's probably not worth trying to find a way to handle this for now. If it turns out the issue is widespread, we can re-visit this.

Thanks!

@DanTup DanTup closed this as completed Feb 7, 2023
@DanTup DanTup added fixed in dart / flutter and removed is bug awaiting info Requires more information from the customer to progress labels Feb 7, 2023
@psimondk
Copy link

psimondk commented Feb 11, 2023

I'm getting this issue revisiting a flutter web project there hasn't been touched for 7 months - so very likely one of the latest dart extension upgrades is the culprit - its very annoying and i do not really wanna do a 2.x 3.x upgrade as we're close to go-live for a large client

@DanTup
Copy link
Member

DanTup commented Feb 13, 2023

@psimondk the quickest fix would be rolling back the Dart extension to v3.56:

Screenshot 2023-02-13 at 11 29 12

I'll have a look to see whether there's a version we can gate on that avoids this issue for both web/non-web.

@DanTup DanTup changed the title Debugger stuck on waiting for connection from debug service on chrome when trying to run on web Debugger stuck on waiting for connection from debug service on chrome when trying to run on web using Flutter 2.x Feb 13, 2023
@DanTup DanTup reopened this Feb 13, 2023
@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session is bug and removed fixed in dart / flutter labels Feb 13, 2023
@DanTup DanTup added this to the v3.60.0 milestone Feb 13, 2023
@DanTup DanTup closed this as completed in aeea8df Feb 13, 2023
@DanTup
Copy link
Member

DanTup commented Feb 13, 2023

I've updated the version for when the extension start using the new API to something I believe works for both cases. If you switch to the Pre-release channel for the extension, you'll get this fix now without needing to use an older version of the extension:

Screenshot 2023-02-13 at 12 19 54

You can switch back to the stable versions of the extension after the next release (or, stick with this - it should generally be stable anyway, as it's usually only published to make fixes like this available to people a little sooner).

@psimondk
Copy link

psimondk commented Feb 19, 2023 via email

@DanTup DanTup pinned this issue Feb 20, 2023
@lbevilacqua
Copy link

Hello,

I encountered the issue too on a Flutter 2.10.5 project.
Using the Dart extension pre-release version solved it.

Thanks

@DanTup DanTup unpinned this issue Mar 22, 2023
@sperochon
Copy link

Hello,

If it can help someone...

I had the same issue on a Flutter 2.10 project using Android Studio and Flutter plugin (version 73).
As suggested by previous comments, I have installed previous release of Flutter plugin (version 72) manually and it is now working fine.

Here are the steps :

  1. I have downloaded the zip plugin file here (be careful to select "compatibility" to "Android Studio"):
    https://plugins.jetbrains.com/plugin/9212-flutter/versions/stable

  2. Then installed the file manually as described here :
    https://stackoverflow.com/a/17358862/1836827

And it works :-)

@cezarwin
Copy link

cezarwin commented Jul 1, 2024

If you are using VPN, please disconnect/logout. And try again. It will work in my experience.

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 is bug
Projects
None yet
Development

No branches or pull requests

6 participants