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
- Configure a slow Windows machine or restrict localhost loopback speeds.
- Run
flutter run -d chrome.
- 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.
Description
When running
flutter run -d chromeon Windows,flutter_toolscrashes 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.dartawaitsconnectDebugviaunawaitedwithout attaching a.catchErrorhandler, allowing theTimeoutExceptionfromdwdsto escape as an unhandled async error and crash the entire CLI runner process.Repro Steps
flutter run -d chrome.Debugger.enabletakes 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 serviceand terminate the session gracefully via
throwToolExitwithout throwing a raw unhandled stack trace.