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

Running Web projects fail due to trying to pass --devtools-server-address to webdev #3167

Closed
sma opened this issue Feb 26, 2021 · 3 comments
Closed
Labels
in web Relates to running Dart or Flutter web apps is bug
Milestone

Comments

@sma
Copy link

sma commented Feb 26, 2021

Create a simple web app with dart create -t simple-web bug. Go to web/main.dart and click on code lens "Run".

The application does not run.

Instead, I get this error (shortened) in the debug console:

Could not find an option named "devtools-server-address".
Usage: webdev daemon [arguments]
    --launch-app                           The html file to launch in chrome.
...
Run "webdev help" to see global options.
Exited (64)

My guess is that Dartcode tries to call webdev with a command line option that is intended for the Flutter devtools.

I also noticed that the argument is passed twice in the generated launch configuration.

Here a captured debug log…

``` !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

Dart Code extension: 3.19.2
Flutter extension: 3.19.0 (not activated)

App: Visual Studio Code
Version: 1.53.2
Platform: mac

Workspace type: Dart
Analyzer type: LSP
Multi-root?: false

Dart SDK:
Loc: /Users/sma/Work/flutter/bin/cache/dart-sdk
Ver: 2.13.0-79.0.dev
Flutter SDK:
Loc: /Users/sma/Work/flutter
Ver: 1.27.0-9.0.pre.112

HTTP_PROXY: undefined
NO_PROXY: undefined

Logging Categories:
General, CommandProcesses, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, PubTest, WebDaemon

Fri Feb 26 2021 [21:57:33 GMT+0100 (Mitteleuropäische Normalzeit)] Log file started
[21:57:36] [General] [Info] Starting debug session...
[21:57:36] [General] [Info] workspace: /Users/sma/Work/bug
[21:57:36] [General] [Info] program : /Users/sma/Work/bug/web/main.dart
[21:57:36] [General] [Info] Using workspace as cwd: /Users/sma/Work/bug
[21:57:36] [General] [Info] Detected launch project as Web
[21:57:36] [General] [Info] Using Web debug adapter for this session
[21:57:36] [General] [Info] Spawning /Users/sma/Work/flutter/bin/cache/dart-sdk/bin/pub with args ["global","list"]
[21:57:36] [CommandProcesses] [Info] (PROC 3070) Logging data for process...
[21:57:36] [CommandProcesses] [Info] (PROC 3070) devtools 0.9.7+3
[21:57:36] [CommandProcesses] [Info] (PROC 3070)
stagehand 3.2.0
webdev 2.7.1
[21:57:36] [CommandProcesses] [Info] (PROC 3070) exited (0, null)
[21:57:36] [CommandProcesses] [Info] (PROC 3070) closed (0, null)
[21:57:36] [General] [Info] Getting DevTools server address to pass to Flutter...
[21:57:36] [General] [Info] Checking for errors before launching
[21:57:36] [General] [Info] Debug session starting...
{
"name": "Dart ",
"noDebug": true,
"request": "launch",
"type": "dart",
"program": "/Users/sma/Work/bug/web/main.dart",
"cwd": "/Users/sma/Work/bug",
"toolEnv": {
"FLUTTER_HOST": "VSCode",
"PUB_ENVIRONMENT": "vscode.dart-code"
},
"sendLogsToClient": true,
"args": [
"--devtools-server-address",
"http://127.0.0.1:9100/",
"--devtools-server-address",
"http://127.0.0.1:9100/"
],
"vmAdditionalArgs": [],
"vmServicePort": 0,
"dartSdkPath": "/Users/sma/Work/flutter/bin/cache/dart-sdk",
"maxLogLineLength": 2000,
"debugSdkLibraries": false,
"debugExternalLibraries": false,
"showDartDeveloperLogs": true,
"evaluateGettersInDebugViews": true,
"evaluateToStringInDebugViews": true,
"flutterSdkPath": "/Users/sma/Work/flutter",
"globalFlutterArgs": [],
"useFlutterStructuredErrors": true,
"useInspectorNotificationsForWidgetErrors": true,
"debugExtensionBackendProtocol": "ws",
"forceFlutterVerboseMode": true,
"flutterTrackWidgetCreation": true,
"flutterMode": "debug",
"flutterPlatform": "default",
"workspaceConfig": {
"useLsp": true,
"startDevToolsServerEagerly": true
},
"showMemoryUsage": false,
"debuggerType": 4
}
[21:57:36] [General] [Info] Using web debugger for Web
[21:57:36] [General] [Info] Running debugger via node with /Users/sma/.vscode/extensions/dart-code.dart-code-3.19.2/out/dist/debug.js web
[21:57:36] [General] [Warn] Did not find session 312086ea-9fc1-41b9-8559-10797130e167 to handle dart.progressStart. There were 0 sessions:
[21:57:36] [General] [Warn] Event will be queued and processed when the session start event fires
[21:57:36] [General] [Info] Processing delayed event dart.progressStart for session 312086ea-9fc1-41b9-8559-10797130e167
[21:57:36] [WebDaemon] [Info] [Dart ] Spawning /Users/sma/Work/flutter/bin/cache/dart-sdk/bin/pub with args ["global","run","webdev","daemon","--devtools-server-address","http://127.0.0.1:9100/","--devtools-server-address","http://127.0.0.1:9100/"]
[21:57:36] [WebDaemon] [Info] [Dart ] .. in /Users/sma/Work/bug
[21:57:36] [WebDaemon] [Info] [Dart ] .. with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[21:57:36] [WebDaemon] [Info] [Dart ] PID: 3073
[21:57:36] [WebDaemon] [Info] [Dart ] <== Could not find an option named "devtools-server-address".
[21:57:36] [WebDaemon] [Info] [Dart ] <== Usage: webdev daemon [arguments]
[21:57:36] [WebDaemon] [Info] [Dart ] <== --launch-app The html file to launch in chrome.
[21:57:36] [WebDaemon] [Info] [Dart ] <== -h, --help Print this usage information.
[21:57:36] [WebDaemon] [Info] [Dart ] <== -o, --output A directory to write the result of a build to. Or a mapping from a top-level directory in the package to the directory to write a filtered build output to. For example "web:deploy".
[21:57:36] [WebDaemon] [Info] [Dart ] <== A value of "NONE" indicates that no "--output" value should be passed to build_runner.
[21:57:36] [WebDaemon] [Info] [Dart ] <== (defaults to "NONE")
[21:57:36] [WebDaemon] [Info] [Dart ] <== -r, --[no-]release Build with release mode defaults for builders.
[21:57:36] [WebDaemon] [Info] [Dart ] <== --[no-]build-web-compilers If a dependency on build_web_compilers is required to run.
[21:57:36] [WebDaemon] [Info] [Dart ] <== (defaults to on)
[21:57:36] [WebDaemon] [Info] [Dart ] <== -e, --[no-]enable-expression-evaluation Enable expression evaluation features in the debugger.
[21:57:36] [WebDaemon] [Info] [Dart ] <== -v, --verbose Enables verbose logging.
[21:57:36] [WebDaemon] [Info] [Dart ] <== Run "webdev help" to see global options.
[21:57:36] [WebDaemon] [Info] [Dart ] Process terminated! 64, null
[21:57:36] [VmService] [Info] [Dart ] Process exited (64)
[21:57:36] [VmService] [Info] [Dart ] Disconnect requested!
[21:57:36] [VmService] [Info] [Dart ] TERM: Requested to terminate with SIGINT...
[21:57:36] [VmService] [Info] [Dart ] TERM: Did not need to terminate processes
[21:57:36] [VmService] [Info] [Dart ] TERM: Removing all stored data...
[21:57:36] [VmService] [Info] [Dart ] TERM: Waiting for process to finish...
[21:57:36] [VmService] [Info] [Dart ] TERM: Disconnecting...
[21:57:36] [General] [Info] Debugger:SessionDuration timing: 413ms (Web)
Fri Feb 26 2021 [21:57:40 GMT+0100 (Mitteleuropäische Normalzeit)] Log file ended

</details>
@sma sma added the is bug label Feb 26, 2021
@DanTup
Copy link
Member

DanTup commented Mar 1, 2021

I don't seem to be able to repro this, it runs without issue from the Run CodeLens for me:

Screenshot 2021-03-01 at 10 24 21

In your log I see this in the launch args though:

"args": [
"--devtools-server-address",
"http://127.0.0.1:9100/",
"--devtools-server-address",
"http://127.0.0.1:9100/"
],

Though it's not clear where they came from. Do they appear in your .vscode/launch.json? If not, does it only occur from the CodeLens, or also when you press F5 to run?

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Mar 1, 2021
@DanTup
Copy link
Member

DanTup commented Mar 1, 2021

Actually, I think I can see a bug, although it's not clear why I'm not hitting it:

const isAnyFlutter = debugType === DebuggerType.Flutter || debugType === DebuggerType.Web;

This looks very wrong - it's deciding web apps are Flutter, and that could trigger sending the arg. I'll do some debugging to find out why I don't see it and get a fix. Thanks!

@DanTup DanTup added in web Relates to running Dart or Flutter web apps and removed awaiting info Requires more information from the customer to progress labels Mar 1, 2021
@DanTup DanTup changed the title [Dart Web] Running Web projects fail due to trying to pass --devtools-server-address to webdev Mar 1, 2021
@DanTup
Copy link
Member

DanTup commented Mar 1, 2021

Ok, I know what's happening. I'm running the beta version of the next release, and the fix for #3142 accidentally fixes this (by preventing DevTools from starting up, which prevents its address from trying to be sent).

Working on a fix, sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in web Relates to running Dart or Flutter web apps is bug
Projects
None yet
Development

No branches or pull requests

2 participants