Dart-code: Flutter Hot Reload and Hot Restart disappeared in VSCode on Flutter master branch

Created on 15 Jul 2019  ·  8Comments  ·  Source: Dart-Code/Dart-Code

Few issues found here:

  1. Hot reload does not work on-saved
  2. Cannot find "Flutter: Hot Reload" and "Flutter: Hot Restart" command in the Command Palette.
    Screenshot 2019-07-15 at 1 23 02 PM

Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.8.2-pre.33, on Mac OS X 10.14.5 18F132, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.36.1)
[✓] Connected device (3 available)

in debugger in flutter is bug

Most helpful comment

I've published a patch as v3.2.1 that contains this fix.

All 8 comments

Hot reload does not work on-save

Do you see any output in the Debug Console like "Reloaded x of y libraries"? Can you capture a log by running the Dart: Capture Logs command from the command palette, then run your app and try a few edits/saves, then click Stop Logging on the log notification (which may have collapsed into the bell icon in the status) bar and attach the log?

Cannot find "Flutter: Hot Reload" and "Flutter: Hot Restart" command in the Command Palette.

This could happen if we didn't detect any Flutter projects in your folder. Is the Flutter project within the top 3 levels of folders in your workspace? It could also be caused if the extension fails to activate (though probably you'd notice a lot more broken if that's the case) - you can check that by opening the developer tools (Help -> Toggle Developer Tools) and checking the console.

Could you also confirm your version of the Dart extension and the Flutter extension? Thanks!

  1. Attached log.
    Dart-Code-Log-2019-06-01 16-23-45.txt

  2. Yes, I am in the project folder because I can run the project by short-key (F5) in Mac.
    Hot-Reload and Hot-Restart both can be trigger by the following buttons:
    Screenshot 2019-07-15 at 4 30 47 PM

  3. Dart and Flutter extensions are both at 3.2.0.

I have also checked for these
Screenshot 2019-07-15 at 4 41 54 PM

Thanks! It looks like the Hot Reload service (reloadSources) is not being registered, and our hot-reload-on-save handler quits early if the service is not available.

@bkonyi I would expect to be fixed by https://github.com/flutter/flutter/pull/35765, but I can repro this on current master. Any ideas?

@pczn0327 as an immediate workaround, if you're able to switch to the Flutter stable channel, that shouldn't have this issue (and also shouldn't be too far behind since it was updated recently).

Thanks for the help @DanTup! I look forward for v3.3.0!

Ok, I figured out what this is. The name of the stream changed in the VM but I haven't published an updated VS Code extension to handle it, so the current live version fails to subscribe, and therefore never sees the service registered.

It's fixed in latest code, so if you're desperate to use master, you can install one of the preview builds of v3.3 like https://github.com/Dart-Code/Dart-Code/releases/tag/v3.3.0-alpha.2.logging.2.

I've published a patch as v3.2.1 that contains this fix.

My issue was that I had a release apk installed on the device, and was installing debug apk. So Hot Reload option was not being shown and vs code was stuck on assemble debug.

Was this page helpful?
0 / 5 - 0 ratings