Skip to content

[Web] flutter_tools crashes with unhandled TimeoutException when DWDS WebkitDebugger fails to connect on Windows #186963

Description

@bkonyi

Description

When running flutter run -d chrome on Windows, flutter_tools crashes with an unhandled asynchronous exception if the Chrome Remote Debugging port takes longer than 15 seconds to respond to the debugger domain activation command.

This is because resident_web_runner.dart awaits connectDebug via unawaited without attaching a .catchError handler, allowing the TimeoutException from dwds to escape as an unhandled async error and crash the entire CLI runner process.

Repro Steps

  1. Configure a slow Windows machine or restrict localhost loopback speeds.
  2. Run flutter run -d chrome.
  3. If Debugger.enable takes longer than 5 seconds across 3 attempts, the tool crashes instead of failing gracefully.

Expected Behavior

The tool should print a descriptive warning:
Error: Failed to establish connection with the web debug service
and terminate the session gracefully via throwToolExit without throwing a raw unhandled stack trace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-webOwned by Web platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions