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
[flutter_tools] Unhandled DartDevelopmentServiceException when WebSocket upgrade fails during DDS startup in ResidentWebRunner #191179
In Flutter 3.47.0 telemetry, an unhandled DartDevelopmentServiceException during web debugging startup emerged as a top crash signature.
When DDS fails to upgrade its WebSocket connection to DWDS (e.g., due to early browser termination or socket closure), package:dds throws DartDevelopmentServiceException with error code connectionError (Code 3). Because ResidentWebRunner.run() only handled failedToStartError and re-threw other error codes, the exception escaped unhandled and crashed the tool.
DartDevelopmentServiceException: WebSocketChannelException: WebSocketException: Connection to 'http://127.0.0.1:62932/9fVOXxsamo0=/ws#' was not upgraded to websocket
Root Cause
In packages/flutter_tools/lib/src/isolated/resident_web_runner.dart, the on DartDevelopmentServiceException handler checked:
if (error.errorCode ==DartDevelopmentServiceException.failedToStartError) {
throwToolExit(kExitMessage);
}
rethrow;
When WebSocket upgrade failed, package:dds threw DartDevelopmentServiceException.connectionIssue() with errorCode == DartDevelopmentServiceException.connectionError (3). The condition evaluated to false, hitting rethrow; and crashing the tool.
Proposed Fix
Update on DartDevelopmentServiceException in ResidentWebRunner.run() to catch all DDS exception variants, log error diagnostics with stack trace, call appFailedToStart(), and gracefully exit via throwToolExit(kExitMessage) without rethrowing.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[flutter_tools] Handle all DartDevelopmentServiceExceptions gracefull…
[stable] [flutter_tools] Handle all DartDevelopmentServiceExceptions …
github-actions commentedon Sep 1, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.