9

After upgrading VS Code version to 1.32.1 automatic hot reloading is not triggered by saving / auto saving. It worked like a charm before.

Hot reloading still works by pressing hot reload button.

According to Flutter doctor Flutter seems OK:

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.2 18C54, locale hu-HU)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)

[✓] Android Studio (version 3.2)

[✓] VS Code (version 1.32.1)

[✓] Connected device (2 available)

Do you have the same experiences? Do you have any suggestions to solve it?

gi097
  • 7,313
  • 3
  • 27
  • 49
Tom
  • 3,899
  • 22
  • 78
  • 137
  • 4
    related https://twitter.com/DartCode/status/1103967129752297473 – Rémi Rousselet Mar 08 '19 at 10:42
  • 1
    https://github.com/Dart-Code/Dart-Code/issues/1518 – Tirth Patel Mar 08 '19 at 10:44
  • 1
    Thanks Folks, I have not found this info, you helped me a lot! – Tom Mar 08 '19 at 10:44
  • 1
    Tip: to prevent auto upgrading to latest Version of VsCode in the future go to files-->Preferences-->Settings and choose Update: Mode to Manual or none – Mahesh Jamdade Mar 08 '19 at 13:07
  • **2021 UPDATE: Hot reload doesn't work on autosave again because of the latest version of dart and flutter extension. Take a look at https://stackoverflow.com/questions/65975713/flutter-doesnt-hot-reload-on-autosave-in-vscode for the fix.** – CoderUni Jan 31 '21 at 05:11

3 Answers3

16

Edit: This issue has been fixed in VS Code 1.32.2 which is now live.


VS Code 1.32 has a nasty regression that's throwing errors during the debug session launch that's stopping a few things from working.

I would recommend temporarily downgrading to VS Code 1.31 (there are download links at the top of the v1.31 release notes) until the fix is released.

As of Saturday 9th March the fix is in master, it should appear in the Insiders build on Mon 11th March and is planned for a recovery release. I hope it won't take too long to release, it is tagged as important in the issue tracker (I'm not on the VS Code team though!).

Relevant issues:

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • 1
    for the Vs code Version 1.31 visit here https://code.visualstudio.com/updates/v1_31 – Mahesh Jamdade Mar 08 '19 at 13:13
  • Is there a way to downgrade and keep all your settings and plugins? – Rasmus Christensen Mar 10 '19 at 00:17
  • @RasmusChristensen I wouldn't expect you to lose anything downgrading normally. Settings and plugins are stored in ~/.vscode and as long as you're not switching between stable/insiders/oss it should persist (it seemed to for me, but note I'm not a Code developer so don't know the ins and outs). – Danny Tuppeny Mar 10 '19 at 09:19
  • @DannyTuppeny Works perfect, as long as you remember do disable auto updates and remember to download the previous version :) HotReload works again running 1.31.xxx Thanks for the workaround – Rasmus Christensen Mar 10 '19 at 12:34
  • 1
    Great :) If you keep an eye on https://twitter.com/DartCode/ or https://gitter.im/dart-code/Dart-Code I'll post when the fix hits stable and it's safe to upgrade again. – Danny Tuppeny Mar 10 '19 at 12:41
4

Edit: This issue has been fixed in VS Code 1.32.2 which is now live. No, it's not fixed in 1.32.2!

enter image description here

it dosn't work at all for me. I don't see neither loading icon, nor hot-reloaded changes

korgara
  • 359
  • 2
  • 6
  • I can confirm it's not 100% fixed. The command line prints a successful Hot Reload message but the little progress dialog for hot reloading doesn't show anymore – oliverbytes Mar 16 '19 at 09:34
  • Yep, I have also tested and it is ok. Thank you for your efforts! – Tom Mar 18 '19 at 08:09
3

I had the same problem. Currently I am using VSCode version 1.39.2.

For the hot reload to work you need to start debugging in VSCode.

As it says in the docs: "Only Flutter apps in debug mode can be hot reloaded." https://flutter.dev/docs/development/tools/hot-reload

You can find that option on the VSCode's top navigation inside Debug or with the shortcut F5.

You don't need to do flutter run on your terminal, nor even on VSCode, is just start debugging and it will launch lib/main.dart in debug mode.

If that doesn't solve the problem, try downgrading to the last version of VSCode.

Iandra Bedin
  • 116
  • 1
  • 1
  • 6