Describe the bug
It is concerning that the default Flutter app created in VSCode has a configuration that prevents a workable launch, following the official doc instructions. There is also no official documentation (and limited online community) coverage on this issue.
To Reproduce
Steps to reproduce the behavior:
{
"name": "Flutter for web",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"args": [
"-d",
"chrome"
]
}
then it launches as desired
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
I'm not unable to reproduce this, by creating a new project and clicking Run -> Run Without Debugging it ran on a random port:
Could you capture a log?
Thanks!
I tried to launch a new project with VSCode Flutter extension, however this time I got the right launch config
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "test2911",
"request": "launch",
"type": "dart"
}
]
}
instead of the one that caused the error which contained
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
},
Ah, I see. pwa-chrome
is not related to this extension, and therefore we can't control what it does. I suspect when you tried to run the project you didn't have a Dart file open, so it should've shown this prompt:
Here only the "Dart & Flutter" option will invoke our code. If you run the others, it will invoke their debuggers.
Let me know if you have any further issues/questions!
Most helpful comment
Ah, I see.
pwa-chrome
is not related to this extension, and therefore we can't control what it does. I suspect when you tried to run the project you didn't have a Dart file open, so it should've shown this prompt:Here only the "Dart & Flutter" option will invoke our code. If you run the others, it will invoke their debuggers.
Let me know if you have any further issues/questions!