Skip to content

Web-server hot reload/restart crashes #183923

Description

@BirjuVachhani

Steps to reproduce

Running web-server with hot reload/restart support across proxy breaks. I have seen it breaking on local network as well as when behind a proxy. When running on localhost and accessing from localhost, it works fine but when accessing through IP from a different computer on the same network or when behind a proxy, it breaks.

  1. Run flutter run -d web-server --web-port=3001 --web-launch-url=http://192.168.0.210:3001.
  2. Open the http://192.168.0.210:3001 on a different computer on the same Network.
  3. It loads just fine.
  4. Do a hot reload/restart.
  5. The loaded website becomes blank and the server crashes.

Expected results

Successful hot reload/restart.

Actual results

Crashes the server and the loaded website becomes blank.

Code sample

Code sample

Run flutter create to create a sample project. Should be reproducible with any flutter projects.

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
flutter run -d web-server --web-port=3001 --web-launch-url=http://192.168.0.210:3001
Launching lib/main.dart on Web Server in debug mode...
Warning: In index.html:37: Flutter's service worker is deprecated and will be removed in a future
Flutter release. See https://github.com/flutter/flutter/issues/156910 for more details.
Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load"
instead. See https://docs.flutter.dev/platform-integration/web/initialization for more details.
Waiting for connection from debug service on Web Server...          9.2s
lib/main.dart is being served at http://localhost:3001
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome
or Edge devices for an improved development workflow.

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

Debug service listening on ws://127.0.0.1:55112/hGztuaa-lhs=/ws
A Dart VM Service on Web Server is available at: http://127.0.0.1:55112/hGztuaa-lhs=
The Flutter DevTools debugger and profiler on Web Server is available at:
http://127.0.0.1:55112/hGztuaa-lhs=/devtools/?uri=ws://127.0.0.1:55112/hGztuaa-lhs=/ws

Warning: In index.html:37: Flutter's service worker is deprecated and will be removed in a future
Flutter release. See https://github.com/flutter/flutter/issues/156910 for more details.
Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load"
instead. See https://docs.flutter.dev/platform-integration/web/initialization for more details.
WebSocketProxyService: Hot reload failed: TimeoutException after 0:00:10.000000: Hot reload timed out -
received 0/1 responses
Hot reload failed:
TimeoutException after 0:00:10.000000: Hot reload timed out - received 0/1 responses.
Try performing a hot restart instead.
Performing hot reload...                                           10.0s
Try again after fixing the above error(s).

Warning: In index.html:37: Flutter's service worker is deprecated and will be removed in a future
Flutter release. See https://github.com/flutter/flutter/issues/156910 for more details.
Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load"
instead. See https://docs.flutter.dev/platform-integration/web/initialization for more details.
WebSocketProxyService: Hot restart failed: TimeoutException after 0:00:15.000000: Hot restart timed out
- received 0/1 responses
Performing hot restart...                                          15.0s
s1.hotRestart: (-32603) Hot restart failed: TimeoutException after 0:00:15.000000: Hot restart timed
out - received 0/1 responses

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.41.5, on macOS 26.3.1 25D771280a darwin-arm64, locale en-IN) [1,486ms]
    • Flutter version 3.41.5 on channel stable at /Users/birjuvachhani/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2c9eb20739 (2 days ago), 2026-03-17 16:14:01 -0700
    • Engine revision 052f31d115
    • Dart version 3.11.3
    • DevTools version 2.54.2
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, enable-custom-devices, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [10.4s]
    • Android SDK at /Users/birjuvachhani/Library/Android/sdk
    • Emulator version 36.4.10.0 (build_id 15004761) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • ANDROID_HOME = /Users/birjuvachhani/Library/Android/sdk
    • Java binary at: /usr/bin/java
      This JDK was found in the system PATH.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version Java(TM) SE Runtime Environment (build 21.0.9+7-LTS-338)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.3) [4.9s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C529
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (4 available) [10.1s]
    • Birju’s iPhone (wireless) (mobile)  • 00008110-000E35A83A82401E • ios            • iOS 26.3.1 23D8133
    • Jemini’s iPhone (wireless) (mobile) • 00008110-001E6D5C34C0A01E • ios            • iOS 26.3.1 23D8133
    • macOS (desktop)                     • macos                     • darwin-arm64   • macOS 26.3.1 25D771280a darwin-arm64
    • Chrome (web)                        • chrome                    • web-javascript • Google Chrome 146.0.7680.81

[✓] Network resources [1,286ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: crashStack traces logged to the consolehas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-toolOwned by Flutter Tool 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