Skip to content

Flutter Hot Reload and Hot Restart disappeared in VSCode on Flutter master branch #1859

Closed

Description

@PhilipChng

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)

Activity

  1. DanTup commented on Jul 15, 2019

    @DanTup
    Member

    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!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Jul 15, 2019
  3. PhilipChng commented on Jul 15, 2019

    @PhilipChng
    Author
    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

  4. DanTup commented on Jul 15, 2019

    @DanTup
    Member

    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 flutter/flutter#35765, but I can repro this on current master. Any ideas?

  5. added and removed
    awaiting infoRequires more information from the customer to progress
    on Jul 15, 2019
  6. added this to the v3.3.0 milestone on Jul 15, 2019
  7. DanTup commented on Jul 15, 2019

    @DanTup
    Member

    @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).

  8. PhilipChng commented on Jul 15, 2019

    @PhilipChng
    Author

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

  9. DanTup commented on Jul 15, 2019

    @DanTup
    Member

    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.

  10. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    in flutterRelates to running Flutter apps
    and removed on Jul 15, 2019
  11. changed the title [-]Flutter Hot Reload and Hot Restart disappeared in VSCode[/-] [+]Flutter Hot Reload and Hot Restart disappeared in VSCode on Flutter master branch[/+] on Jul 15, 2019
  12. modified the milestones: v3.3.0, v3.2.1 on Jul 16, 2019
  13. DanTup commented on Jul 16, 2019

    @DanTup
    Member

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

  14. sheerazam commented on Sep 7, 2020

    @sheerazam

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsin flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions