question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode HMR not working with Flutter while Debugging

See original GitHub issue

HMR works with flutter run & then pressing r & even R for Live Reloading but does not work with Debugger when pressed with fn+F5 on Mac

My simple code is -

lib/main.dart

import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Hello, Universe!"),
        ),
        body: Container(
          decoration: BoxDecoration(
            color: Colors.red,
          ),
          child: Text("One"),
        ),
      ),
    ));

And I change One to Two to test HMR but it doesn’t work. The below is a log for running app & changing One to Two in the Text widget.

Dart-Code-Log-2018-11-00 15-36-50.txt

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Dec 3, 2018

Glad to hear it’s all working (even though I am still slightly confused by the shortcuts and debug dropdown!). Do let me know if you hit any issues!

0reactions
DanTupcommented, Sep 14, 2020

@MuhammamdArslanKhan if you’re having issues, please file a new issue. You can capture logs using the capture logs command - you can untick Analysis Server but leave everything else ticked.

Edit: I’ll respond over on https://github.com/Dart-Code/Dart-Code/issues/2786!

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode hot reload for Flutter does not work - Stack Overflow
To solve the issue first close the running debugging session using Shift+f5. Then click debug from the menu bar. Click Start without debugging....
Read more >
Hot reload - Flutter documentation
Hot reload works by injecting updated source code files into the running Dart ... Only Flutter apps in debug mode can be hot...
Read more >
Flutter Hot Reload Not Working in VS Code FIX ... - YouTube
IMPORTANT NOTE: "Hot Reload" only works for changes that are made INSIDE of the build() method, whereas "Hot Restart" are for changes ...
Read more >
Error loading ASGI app. Could not import module "main"
I have been having issues debugging flutter app on IOS Simulator either by running flutter run or hit run without debuging on vs...
Read more >
How to fix debugging Flutter in VS Code
It's really fascinating since it uses Material Design theme and it almost looks the same in iOS and Android. Problem. Now all these...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found