You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chrome spawns additional window that must be closed before Flutter web app loads when running in verbose mode #3206
When starting a Flutter app for the web (either with Chrome or Edge), Dart-Code continuously displays "Compiling lib\main.dart for the Web..." and this message doesn't go away even after a few minutes after the app is running in Chrome/Edge.
Also, and this is probably related, I can not start the Dart DevTools because when I click the corresponding button in the status bar, I get this message instead: "This debug session is not ready yet."
Expected behavior
"Compiling lib\main.dart for the Web..." message disappears when the app finished compiling and is launched.
And be able to start DevTools.
Does this happen in a newly created project (using the Flutter: New Application Project command)? Could you try capturing debugging logs while reproducing this?
I don't have the same issue today for some reason: I don't see the "Compiling lib\main.dart for the Web..." message anymore when running normally and I can use launch the Dart DevTools.
But the behavior is different while running Capture Debugging Logs: the app startup in debug stays stuck on "waiting for connection from debug service on Edge/Chrome".
I also found an issue in my code: I had a call to Platform.isWindows that fails when running on the Web.
I am still attaching logs in case they can be useful:
But the behavior is different while running Capture Debugging Logs: the app startup in debug stays stuck on "waiting for connection from debug service on Edge/Chrome".
To make sure I understand correctly - your app appears to work fine now if you're not capturing logs, but hangs when you are capturing logs? Can you reliably reproduce this? Capturing logs shouldn't change any behaviour, so if that's happening it sounds like a significant issue. Are there any errors listed in the VS Code dev tools (Help -> Toggle Developer Tools) when this happens?
Yes, you understood correctly: the behavior is different when capturing logs, and I could reproduce it.
When I debug normally, a new profile starts in Chrome and starts loading my application.
Whereas when I debug while capture logs is enabled, my main profile is used to start a first instance of Chrome but stays on an empty page. Even after waiting for a while, my application does not start in this first instance. But when I close this first instance of Chrome, a second one opens, this time with a new profile, and my application starts loading in this second instance.
I captured two screencasts showing this:
Starting debug normally:
Starting capture logs first then starting debug:
Here is all I have in the Developer Tools Console:
Some messages have been moved to the Issues panel.
abstractExtensionService.ts:722 [ms-vscode.powershell]: Command `workbench.action.positionPanelLeft` appears multiple times in the `commands` section.
abstractExtensionService.ts:722 [ms-vscode.powershell]: Command `workbench.action.positionPanelBottom` appears multiple times in the `commands` section.
DevTools failed to load SourceMap: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/2b9aebd5354a3629c3aba0a5f5df49f43d6689f8/node_modules/windows-process-tree/lib/index.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
@nbros are you able to provide the full log file for the run that spawns a second chrome (keep it capturing until after the second Chrome spawns). You can email it to me at [email protected] if you don't want to post here.
I've tried to repro, but it works as expected here. I'm not sure what's going on. The Chrome instances are spawned by Flutter or DWDS, but if it's a bug there it doesn't not explain why capturing logs makes a difference.
I'd also be interested to know if enabling the log files (instead of using capture logs) triggers the same issue. The relevant logs are:
I tried adding settings dart.flutterRunLogFile and dart.vmServiceLogFile and I didn't have the issue: the application starts in Chrome or Edge without a first window appearing.
Sorry for the delay, I'm not sure how I missed the previous notifications.
To make sure I understand correctly, if you use the settings to capture logs, everything is fine. But when using the Dart: Capture Logs command, the app fails to launch correctly (it spawns an additional Chrome window, which when closed, allows the app to continue to launch normally)?
Could you try creating a .vscode/launch.json file if you don't already have one, and adding the "-v" flag to args and see whether that causes the issue to reproduce (that's the only other difference I think using Capture Logs makes - it forces Verbose mode).
when using the Dart: Capture Logs command, the app fails to launch correctly (it spawns an additional Chrome window, which when closed, allows the app to continue to launch normally)?
Yes, exactly
if you use the settings to capture logs, everything is fine
No, I reproduced the same issue adding the "-v" flag to args like you suggested.
So the good news for you is this issue is probably not your fault then 😃
It looks like an issue with the -v arg in Flutter itself.
It's still possible that the -v flag is producing more output that is breaking things in VS Code. Are you able to get a log using the settings files mentioned above, but using -v? If I understand correctly, the issue is likely to still occur, but you'd be able to capture a log this way? Thanks!
There are two long delays of 25 and 36 seconds around an error message. I'm guessing this occurred around the time the Chrome window spawned that you had to close, though it's not clear if the error was the cause, or it was just delayed for the same issue.
@grouma any ideas how to debug this further? The issue is that when running on Chrome, a blank Chrome window appears and just does nothing. Closing that window then spawns another window, where the app launches normally. Strangely, it seems to only occur when Flutter is running in verbose mode ("-v").
I think there may be two unrelated issues being described here:
Chrome spawning an additional blank window that must be closed before the app will launch (seems to only occur when running in verbose mode)
VS Code showing "Compiling ..." forever when launching in profile mode
I can actually reproduce (2) so should be easy to narrow down. To avoid confusion I've opened #3338 for that issue, and will rename this one to cover (1).
changed the title [-]persistent "Compiling lib\main.dart for the Web..." and cannot launch DevTools[/-][+]Chrome spawns additional window that must be closed before Flutter web app loads when running in verbose mode[/+]on May 13, 2021
@nbros I think your original issue (the extra Chrome window spawning) may have been fixed by flutter/flutter#78386
It notes:
Do not run 'chrome --version' in verbose mode on windows.
It is not supported and causes opening of accumulating
chrome instances.
This seems to match up with only occurring in verbose mode too. Can you easily test in Flutter's dev or master channels temporarily to confirm if it's fixed for you there? Thanks!
Activity
DanTup commentedon Mar 15, 2021
Does this happen in a newly created project (using the Flutter: New Application Project command)? Could you try capturing debugging logs while reproducing this?
Thanks!
nbros commentedon Mar 20, 2021
Hello,
I don't have the same issue today for some reason: I don't see the "Compiling lib\main.dart for the Web..." message anymore when running normally and I can use launch the Dart DevTools.
But the behavior is different while running
Capture Debugging Logs: the app startup in debug stays stuck on "waiting for connection from debug service on Edge/Chrome".I also found an issue in my code: I had a call to
Platform.isWindowsthat fails when running on the Web.I am still attaching logs in case they can be useful:
Dart-Code-Log-2021-02-06 10-08-11 stuck waiting for connection from debug service on Edge.txt
Dart-Code-Log-2021-02-06 10-14-02 stuck waiting for connection from debug service on Chrome.txt
DanTup commentedon Mar 22, 2021
To make sure I understand correctly - your app appears to work fine now if you're not capturing logs, but hangs when you are capturing logs? Can you reliably reproduce this? Capturing logs shouldn't change any behaviour, so if that's happening it sounds like a significant issue. Are there any errors listed in the VS Code dev tools (Help -> Toggle Developer Tools) when this happens?
Thanks!
nbros commentedon Mar 22, 2021
Yes, you understood correctly: the behavior is different when capturing logs, and I could reproduce it.
When I debug normally, a new profile starts in Chrome and starts loading my application.
Whereas when I debug while capture logs is enabled, my main profile is used to start a first instance of Chrome but stays on an empty page. Even after waiting for a while, my application does not start in this first instance. But when I close this first instance of Chrome, a second one opens, this time with a new profile, and my application starts loading in this second instance.
I captured two screencasts showing this:
Starting debug normally:

Starting capture logs first then starting debug:

Here is all I have in the Developer Tools Console:
DanTup commentedon Mar 23, 2021
@nbros are you able to provide the full log file for the run that spawns a second chrome (keep it capturing until after the second Chrome spawns). You can email it to me at [email protected] if you don't want to post here.
I've tried to repro, but it works as expected here. I'm not sure what's going on. The Chrome instances are spawned by Flutter or DWDS, but if it's a bug there it doesn't not explain why capturing logs makes a difference.
I'd also be interested to know if enabling the log files (instead of using capture logs) triggers the same issue. The relevant logs are:
nbros commentedon Mar 24, 2021
Hello,
Here is the log:
Dart-Code-Log-2021-02-03 18-02-14.txt
The log naming seems wrong : it got named "2021-02-03" whereas today is 2021-03-24.
nbros commentedon Mar 24, 2021
I tried adding settings dart.flutterRunLogFile and dart.vmServiceLogFile and I didn't have the issue: the application starts in Chrome or Edge without a first window appearing.
nbros commentedon Apr 20, 2021
Hello,
This issue still has the awaiting info tag.
Do you need additional info?
DanTup commentedon Apr 21, 2021
Sorry for the delay, I'm not sure how I missed the previous notifications.
To make sure I understand correctly, if you use the settings to capture logs, everything is fine. But when using the Dart: Capture Logs command, the app fails to launch correctly (it spawns an additional Chrome window, which when closed, allows the app to continue to launch normally)?
Could you try creating a
.vscode/launch.jsonfile if you don't already have one, and adding the"-v"flag toargsand see whether that causes the issue to reproduce (that's the only other difference I think using Capture Logs makes - it forces Verbose mode).If it does reproduce with
-v, then please enable the logging settings above and capture a log with verbose mode enabled, and the issue occurring.Thanks!
nbros commentedon May 4, 2021
Hello,
Yes, exactly
No, I reproduced the same issue adding the
"-v"flag toargslike you suggested.So the good news for you is this issue is probably not your fault then 😃
It looks like an issue with the
-varg in Flutter itself.DanTup commentedon May 4, 2021
It's still possible that the
-vflag is producing more output that is breaking things in VS Code. Are you able to get a log using the settings files mentioned above, but using-v? If I understand correctly, the issue is likely to still occur, but you'd be able to capture a log this way? Thanks!nbros commentedon May 4, 2021
Here are the logs with
-venabled:flutterRunLogFile-debug.txt
vmServiceLogFile-debug.txt
(the issue did occur)
DanTup commentedon May 7, 2021
The only interesting thing I found in the logs was this:
There are two long delays of 25 and 36 seconds around an error message. I'm guessing this occurred around the time the Chrome window spawned that you had to close, though it's not clear if the error was the cause, or it was just delayed for the same issue.
@grouma any ideas how to debug this further? The issue is that when running on Chrome, a blank Chrome window appears and just does nothing. Closing that window then spawns another window, where the app launches normally. Strangely, it seems to only occur when Flutter is running in verbose mode ("-v").
amr-eniou-3r commentedon May 12, 2021
@DanTup same issue while running
web with --profileamr-eniou-3r commentedon May 12, 2021
@DanTup I created a new Flutter web project and I have the same issue in Vscode profile mode or Intellij
Until you solve this issue, Is there a workaround I could use to listen to the following URL? no
authcode=on it[ +1 ms] [CHROME]:DevTools listening on ws://127.0.0.1:50376/devtools/browser/95ce9951-599a-4434-8d45-d6c4f523bd82The issue mostly for
Flutter web profile mode
DanTup commentedon May 13, 2021
I think there may be two unrelated issues being described here:
I can actually reproduce (2) so should be easy to narrow down. To avoid confusion I've opened #3338 for that issue, and will rename this one to cover (1).
[-]persistent "Compiling lib\main.dart for the Web..." and cannot launch DevTools[/-][+]Chrome spawns additional window that must be closed before Flutter web app loads when running in verbose mode[/+]DanTup commentedon May 13, 2021
@nbros I think your original issue (the extra Chrome window spawning) may have been fixed by flutter/flutter#78386
It notes:
This seems to match up with only occurring in verbose mode too. Can you easily test in Flutter's
devormasterchannels temporarily to confirm if it's fixed for you there? Thanks!nbros commentedon May 14, 2021
Hello,
I tested on
devand I confirm it works: I didn't have to close a window before my app launched!Thanks
DanTup commentedon May 17, 2021
Excellent - thanks for confirming!