Repository: flutter
Issue: [web] DevTools get disconnected on hot reload when running app in debug mode in browser
Labels: tool,platform-web,d: devtools,P2,team-web,triaged-web

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Run `flutter create bug`.
2. Choose Chome (web-javascript) in devices.
3. Launch lib/main.dart in debug mode.
4. Open Flutter Devtools.
5. Open main.dart.
6. Ctrl+s.

**Expected results:** DevTools stay up and running

**Actual results:** DevTools get disconnected as if I closed the app.

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
flutter run --verbose -d chrome
[  +15 ms] executing: [/home/alm/.flutter-sdk/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +20 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] fabeb2a16f1d008ab8230f450c49141d35669798
[        ] executing: [/home/alm/.flutter-sdk/] git describe --match v*.*.* --first-parent --long --tags
[   +3 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.14.6-0-gfabeb2a16
[   +4 ms] executing: [/home/alm/.flutter-sdk/] git rev-parse --abbrev-ref --symbolic @{u}
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/home/alm/.flutter-sdk/] git ls-remote --get-url origin
[   +2 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +30 ms] executing: [/home/alm/.flutter-sdk/] git rev-parse --abbrev-ref HEAD
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[  +21 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +28 ms] executing: /home/alm/.android/sdk/platform-tools/adb devices -l
[   +4 ms] Exit code 0 from: /home/alm/.android/sdk/platform-tools/adb devices -l
[        ] List of devices attached
[  +11 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +471 ms] Generating /home/alm/.web-files/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +74 ms] Launching lib/main.dart on Chrome in debug mode...
[        ] Building application for the web...
[+6519 ms] Starting daemon...
[ +209 ms] Initializing inputs
[   +9 ms] Reading cached asset graph...
[ +137 ms] Reading cached asset graph completed, took 135ms

[ +282 ms] Checking for updates since last build...
[ +380 ms] Checking for updates since last build completed, took 380ms

[   +7 ms] Initializing inputs
[   +1 ms] Reading cached asset graph...
[        ] Reading cached asset graph completed, took 135ms
[        ] Checking for updates since last build...
[        ] Checking for updates since last build completed, took 380ms
[ +534 ms] About to build [web]...
[   +2 ms] Running build...
[ +121 ms] Running build completed, took 63ms

[        ] Caching finalized dependency graph...
[  +36 ms] Caching finalized dependency graph completed, took 105ms

[   +8 ms] Succeeded after 178ms with 0 outputs (0 actions)

[   +9 ms] Building application for the web... (completed in 8.3s)
[        ] Attempting to connect to browser instance..
[+2032 ms] Debug service listening on ws://127.0.0.1:36713/-5qo7bX7UEU=

[ +293 ms]       Failed to load asset at path: packages/build_web_compilers/src/dev_compiler/dart_sdk.js.

                          Status code: 404

                          Headers:
                          {
                      "date": "Mon, 17 Feb 2020 21:12:51 GMT",
                      "content-length": "9",
                      "x-frame-options": "SAMEORIGIN",
                      "content-type": "text/plain; charset=utf-8",
                      "x-xss-protection": "1; mode=block",
                      "x-content-type-options": "nosniff",
                      "server": "dart:io with Shelf",
                      "via": "1.1 shelf_proxy"
                    }

                          Content:
                          Not Found}

[  +23 ms] Attempting to connect to browser instance.. (completed in 2.3s)
[   +1 ms] Warning: Flutter's support for web development is not stable yet and hasn't
[        ] been thoroughly tested in production environments.
[        ] For more information see https://flutter.dev/web
[        ] 🔥  To hot restart changes while running, press "r". To hot restart (and refresh the browser), press "R".
[        ] For a more detailed help message, press "h". To quit, press "q".
[   +6 ms] Debug service listening on ws://127.0.0.1:36713/-5qo7bX7UEU=
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
flutter analyze
Analyzing bug...                                                        
No issues found! (ran in 1.5s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
[✓] Flutter (Channel beta, v1.14.6, on Linux, locale en_US.UTF-8)
    • Flutter version 1.14.6 at /home/alm/.flutter-sdk
    • Framework revision fabeb2a16f (3 weeks ago), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /home/alm/.android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /home/alm/.android/sdk/
    • Java binary at: /home/alm/.android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /home/alm/.android-studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.42.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.8.1

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 79.0.3945.88
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!
```

</details>