Skip to content

Hot reload + other debugging functionality stopped working in VS Code 1.32 #1518

Closed

Description

@zarko-tg

All of a sudden hot reloading isn't working anymore for Flutter apps. Main difference/cause is probably that I got a VS Code update just now/today - 1.32.0.

(Restart works as normal).

Give thumbs up if you're affected.


(@DanTup:)

This was a regression in VS Code 1.32 and was fixed in VS Code 1.32.2

Activity

  1. elricym commented on Mar 7, 2019

    @elricym

    Same here. It seems that there is no active debug session within vscode. Try "Dart: Open DevTools".

  2. DanTup commented on Mar 7, 2019

    @DanTup
    Member

    Could you possibly run the Dart: Capture Logs command and tick Flutter Run and Debugger (Observatory),, then launch a debug session and try hot reload a few times (both using the restart button on the debug toolbar, as well as the command in the command palette). Then click Stop Logging on the notification (which may have collapsed into the bell in the status bar) to get the logs.

  3. added
    in flutterRelates to running Flutter apps
    in debuggingRelates to the debug adapter or process of running debug sessions
    awaiting infoRequires more information from the customer to progress
    in commandsRelates to commands (usually invoked from the command Palette)
    on Mar 7, 2019
  4. added this to the v2.25.0 milestone on Mar 7, 2019
  5. zarko-tg commented on Mar 7, 2019

    @zarko-tg
    Author

    @elricym Something fishy.
    Started Debugging, then once up and running -> opened Dart DevTools but always get "Dart DevTools requires an active debug session.".

  6. zarko-tg commented on Mar 7, 2019

    @zarko-tg
    Author

    @DanTup

    !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
    
    Dart Code extension: 2.24.0
    Flutter extension: 2.24.0 (not activated)
    VS Code: 1.32.0
    Platform: mac
    Workspace type: Flutter
    Multi-root?: false
    Dart SDK:
        Loc: /Users/zarko/flutter/bin/cache/dart-sdk
        Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
    Flutter SDK:
        Loc: /Users/zarko/flutter
        Ver: 1.2.1
    HTTP_PROXY: undefined
    NO_PROXY: undefined
    
    Thu Mar 07 2019 [22:56:21 GMT+0100 (CET)] Log file started
    [22:56:32 GMT+0100 (CET)] [General] [Info] Starting debug session...
    [22:56:32 GMT+0100 (CET)] [General] [Info]     workspace: /Users/zarko/repos/int/go-app
    [22:56:32 GMT+0100 (CET)] [General] [Info] Using found common entry point: /Users/zarko/repos/int/go-app/lib/main.dart
    [22:56:32 GMT+0100 (CET)] [General] [Info] Using workspace as cwd: /Users/zarko/repos/int/go-app
    [22:56:32 GMT+0100 (CET)] [General] [Info] Detected launch project as Flutter
    [22:56:32 GMT+0100 (CET)] [General] [Info] Using Flutter debug adapter for this session
    [22:56:32 GMT+0100 (CET)] [General] [Info] Checking for errors before launching
    [22:56:32 GMT+0100 (CET)] [General] [Info] Debug session starting...
        {
            "name": "Flutter",
            "request": "launch",
            "type": "dart",
            "program": "/Users/zarko/repos/int/go-app/lib/main.dart",
            "cwd": "/Users/zarko/repos/int/go-app",
            "args": [],
            "vmAdditionalArgs": [],
            "dartPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/dart",
            "maxLogLineLength": 2000,
            "pubPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/pub",
            "pubSnapshotPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
            "debugSdkLibraries": false,
            "debugExternalLibraries": false,
            "flutterDebuggerRestartBehaviour": "hotReload",
            "evaluateGettersInDebugViews": true,
            "forceFlutterVerboseMode": true,
            "flutterTrackWidgetCreation": true,
            "flutterMode": "debug",
            "flutterPath": "/Users/zarko/flutter/bin/flutter",
            "deviceId": "657C93E8-8BAD-4398-A5B2-7E8282511905",
            "deviceName": "iPhone XR (ios)",
            "showMemoryUsage": false,
            "debugServer": 60616
        }
    Thu Mar 07 2019 [22:57:24 GMT+0100 (CET)] Log file ended
    
    
    [+7600 ms] Refreshing active FlutterViews before reloading.
    [        ] Sending to VM service: _flutter.listViews({})
    [   +3 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x7f9a5e809618, isolate: {type: @Isolate, fixedId: true, id: isolates/819541113, name: main.dart$main-819541113, number: 819541113}}]}
    [ +375 ms] DevFS: Starting sync from LocalDirectory: '/Users/zarko/repos/int/go-app'
    [        ] Scanning project files
    [   +1 ms] Scanning package files
    [  +73 ms] Scanning asset files
    [   +1 ms] Scanning for deleted files
    [   +4 ms] Compiling dart to kernel with 1 updated files
    [  +57 ms] Updating files
    [  +11 ms] DevFS: Sync finished
    [        ] Synced 0.0MB.
    [        ] Sending to VM service: _reloadSources({pause: true, rootLibUri: file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/lib/main.dart.incremental.dill, packagesUri: file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/.packages, isolateId: isolates/819541113})
    [  +35 ms] Result: {type: ReloadReport, success: true, details: {finalLibraryCount: 546, receivedLibraryCount: 4, receivedLibrariesBytes: 27448, receivedClassesCount: 16, receivedProceduresCount: 8, savedLibraryCount: 542, loadedLibraryCount: 4, shapeChangeMappings:...
    [        ] reloaded 4 of 546 libraries
    [        ] Sending reload events to iPhone XR
    [        ] Sending reload event to "main.dart$main-819541113"
    [        ] Sending to VM service: getIsolate({isolateId: isolates/819541113})
    [   +7 ms] Result: {type: Isolate, fixedId: true, id: isolates/819541113, name: main.dart:main(), number: 819541113, _originNumber: 819541113, startTime: 1551995805138, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections: 4, avgCollectionPeriod...
    [   +2 ms] Sending to VM service: _flutter.listViews({})
    [   +1 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x7f9a5e809618, isolate: {type: @Isolate, fixedId: true, id: isolates/819541113, name: main.dart$main-819541113, number: 819541113}}]}
    [        ] Evicting dirty assets
    [        ] Reassembling application
    [        ] Sending to VM service: ext.flutter.reassemble({isolateId: isolates/819541113})
    [  +74 ms] Result: {type: _extensionType, method: ext.flutter.reassemble}
    [        ] Sending to VM service: ext.ui.window.scheduleFrame({isolateId: isolates/819541113})
    [   +3 ms] Result: {type: Success}
    [   +1 ms] Hot reload performed in 656ms.
    [        ] Reloaded 4 of 546 libraries in 660ms.
    [+46222 ms] DevFS: Deleting filesystem on the device (file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/)
    [   +1 ms] Sending to VM service: _deleteDevFS({fsName: go-app})
    [   +8 ms] Result: {type: Success}
    [        ] DevFS: Deleted filesystem on the device (file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/)
    [   +1 ms] Sending to VM service: ext.flutter.exit({isolateId: isolates/819541113})
    [  +25 ms] Service protocol connection closed.
    [ +501 ms] Application finished.
    
  7. elricym commented on Mar 7, 2019

    @elricym

    @DanTup

    Dart Code extension: 2.24.0
    Flutter extension: 2.24.0 (not activated)
    VS Code: 1.32.0
    Platform: mac
    Workspace type: Flutter
    Multi-root?: false
    Dart SDK:
        Loc: /Users/ming/Development/flutter/bin/cache/dart-sdk
        Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
    Flutter SDK:
        Loc: /Users/ming/Development/flutter
        Ver: 1.2.1
    HTTP_PROXY: undefined
    NO_PROXY: undefined
    

    TBH, there is nothing captured after I started debug. Flutter extension: 2.24.0 (not activated) is the weirdest thing here.

  8. odonckers commented on Mar 7, 2019

    @odonckers

    I just started the same issue, and when I tried what @elricym said, to run "Dart: Open DevTools", I got a popup saying that an active debug session doesn't exist. I'm wondering if the previous version would work, but Visual Studio Code is being stupid and won't let me downgrade back to it.

  9. odonckers commented on Mar 7, 2019

    @odonckers

    @DanTup bellow is my logs. I hope you figure this out soon, it has become quite the annoyance.

    Dart Code extension: 2.24.0
    Flutter extension: 2.23.1 (not activated)
    VS Code: 1.32.0
    Platform: mac
    Workspace type: Flutter
    Multi-root?: false
    Dart SDK:
        Loc: /usr/local/flutter/bin/cache/dart-sdk
        Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
    Flutter SDK:
        Loc: /usr/local/flutter
        Ver: 1.2.1
    HTTP_PROXY: undefined
    NO_PROXY: undefined
    
    Thu Mar 07 2019 [17:47:50 GMT-0600 (CST)] Log file started
    [17:47:53 GMT-0600 (CST)] [General] [Info] Starting debug session...
    [17:47:53 GMT-0600 (CST)] [General] [Info]     workspace: /Users/odonckers/Dropbox/knockknock
    [17:47:53 GMT-0600 (CST)] [General] [Info] Using found common entry point: /Users/odonckers/Dropbox/knockknock/lib/main.dart
    [17:47:53 GMT-0600 (CST)] [General] [Info] Using workspace as cwd: /Users/odonckers/Dropbox/knockknock
    [17:47:53 GMT-0600 (CST)] [General] [Info] Detected launch project as Flutter
    [17:47:53 GMT-0600 (CST)] [General] [Info] Using Flutter debug adapter for this session
    [17:47:53 GMT-0600 (CST)] [General] [Info] Checking for errors before launching
    [17:47:53 GMT-0600 (CST)] [General] [Info] Debug session starting...
        {
            "program": "/Users/odonckers/Dropbox/knockknock/lib/main.dart",
            "cwd": "/Users/odonckers/Dropbox/knockknock",
            "name": "Dart & Flutter",
            "type": "dart",
            "request": "launch",
            "args": [],
            "vmAdditionalArgs": [],
            "dartPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/dart",
            "maxLogLineLength": 2000,
            "pubPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/pub",
            "pubSnapshotPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
            "debugSdkLibraries": false,
            "debugExternalLibraries": false,
            "flutterDebuggerRestartBehaviour": "hotReload",
            "evaluateGettersInDebugViews": true,
            "forceFlutterVerboseMode": true,
            "flutterTrackWidgetCreation": true,
            "flutterMode": "debug",
            "flutterPath": "/usr/local/flutter/bin/flutter",
            "deviceId": "5F31C064-299E-4E14-83E7-7B3F535FC8DC",
            "deviceName": "iPhone Xs (ios)",
            "showMemoryUsage": false,
            "debugServer": 50702
        }
    
  10. priezz commented on Mar 8, 2019

    @priezz

    Hot reload works with the VSCode 1.31.0, so the issue should be related to some changes in vscode, not in the plugin itself.

  11. JohnCido commented on Mar 8, 2019

    @JohnCido

    @DanTup
    I'm experiencing hot reload issues too. And I just updated my VS Code this morning to 1.32.1.

    In my case, after changed some properties passed to a widget constructor, manually trigger a hot reload does reflect the changes on the device. But after making changes to a dart file and save it, no automatically reload happens at all.

    Here's the log I captured:

    Dart Code extension: 2.24.0
    Flutter extension: 2.24.0 (not activated)
    VS Code: 1.32.1
    Platform: mac
    Workspace type: Flutter
    Multi-root?: false
    Dart SDK:
        Loc: /SDK_DIRECTORY/bin/cache/dart-sdk
        Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
    Flutter SDK:
        Loc: /SDK_DIRECTORY
        Ver: 1.2.1
    HTTP_PROXY: undefined
    NO_PROXY: undefined
    
    Fri Mar 08 2019 [14:03:32 GMT+0800 (CST)] Log file started
    [14:03:35 GMT+0800 (CST)] [General] [Info] Starting debug session...
    [14:03:35 GMT+0800 (CST)] [General] [Info]     workspace: /DEV_DIRECTORY
    [14:03:35 GMT+0800 (CST)] [General] [Info] Using found common entry point: /DEV_DIRECTORY/sample/lib/main.dart
    [14:03:35 GMT+0800 (CST)] [General] [Info] Using workspace as cwd: /DEV_DIRECTORY
    [14:03:35 GMT+0800 (CST)] [General] [Info] Found better project root to use as cwd: /DEV_DIRECTORY/sample
    [14:03:35 GMT+0800 (CST)] [General] [Info] Detected launch project as Flutter
    [14:03:35 GMT+0800 (CST)] [General] [Info] Using Flutter debug adapter for this session
    [14:03:35 GMT+0800 (CST)] [General] [Info] Checking for errors before launching
    [14:03:35 GMT+0800 (CST)] [General] [Info] Debug session starting...
        {
            "program": "/DEV_DIRECTORY/sample/lib/main.dart",
            "cwd": "/DEV_DIRECTORY/sample",
            "name": "Dart & Flutter",
            "type": "dart",
            "request": "launch",
            "args": [],
            "vmAdditionalArgs": [],
            "dartPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/dart",
            "maxLogLineLength": 2000,
            "pubPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/pub",
            "pubSnapshotPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
            "debugSdkLibraries": false,
            "debugExternalLibraries": false,
            "flutterDebuggerRestartBehaviour": "hotReload",
            "evaluateGettersInDebugViews": true,
            "forceFlutterVerboseMode": true,
            "flutterTrackWidgetCreation": true,
            "flutterMode": "debug",
            "flutterPath": "/SDK_DIRECTORY/bin/flutter",
            "deviceId": "-",
            "deviceName": "-",
            "showMemoryUsage": false,
            "debugServer": 50876
        }
    Fri Mar 08 2019 [14:04:44 GMT+0800 (CST)] Log file ended
    

    And I'm also seeing that dart devtools notification:
    2019-03-08 14 10 15

  12. 24 remaining items

  13. brian-dunn commented on Mar 15, 2019

    @brian-dunn

    VSC 1.32.3 was just released, and it breaks hot reload. So, it looks like we regressed again.

    Sorry if this is a newbie question, but how to I manually downgrade to VSC 1.31?

  14. oliverbytes commented on Mar 16, 2019

    @oliverbytes

    Thanks a lot!! Works again with latest version.

  15. thavlik commented on Mar 20, 2019

    @thavlik

    Thanks a lot!! Works again with latest version.

    Which version are you using? I was just on 1.32.3 and it's not working, but it is working with the Insider's build.

  16. DanTup commented on Mar 20, 2019

    @DanTup
    Member

    @thavlik Can you confirm exactly the behaviour you're seeing, and whether you're seeing "undefined session received in acceptDebugSessionStarted" in the developer console (Help -> Toggle Developer Tools).

  17. sutharsha commented on Mar 23, 2019

    @sutharsha

    @DanTup Am on 1.32.3 and can confirm that its not working for me either. Checked the dev console and there is no "undefined session received in acceptDebugSessionStarted"
    I am going to switch back to 1.31.x.

  18. DanTup commented on Mar 23, 2019

    @DanTup
    Member

    @sutharsha Can you try reproducing the issue, and then when you hit it, run the "Open Dev Tools" command see whether it a) works or b) complains there is no debug session?

    Could you also capture a log (using Dart: Capture Logs with Flutter Run and Observatory ticked)?

    Also - before you edited your message, you said you say a reload message in the debug console - is that accurate? If so, it's probably not VS Code related but a Flutter issue (in which case, rolling VS Code back might not help). If that is the case, please also capture a log as above, but open a new issue with it instead, and I'll take a look.

  19. reopened this on Mar 23, 2019
  20. added
    awaiting infoRequires more information from the customer to progress
    on Mar 23, 2019
  21. sutharsha commented on Mar 23, 2019

    @sutharsha

    @DanTup I had uninstalled and went back to 1.31.1. Updated it back to current 1.32.3. Now unable to reproduce the issue. Hot reload works for now :/.

    And yes i did get the reload message then.
    Sure, If i get it again ll open an issue in flutter.

  22. DanTup commented on Mar 24, 2019

    @DanTup
    Member

    Yeah, if you did see the reload message, then it's definitely not this issue, since the reload message comes from Flutter but the VS Code issue meant the hot reload was never really executed.

    There is an open issue at flutter/flutter#29121 with some reports of hot reload not working correctly (it says it reloaded, but doesn't reflect changes), however some users were making changes in their main method so it's not entirely clear if there's a bug of people just hitting hot reloads limitations.

  23. DanTup commented on May 8, 2019

    @DanTup
    Member

    1.33.1 has been out a while, though I did publish a new extension (v3.0) yesterday.

    @atilkan can you open a new issue with a description of exactly what you see, including a log started prior to launching the app.

    Thanks!

  24. zeh commented on May 8, 2019

    @zeh

    For all it's worth, starting/hot reloading/etc is still working as intended with VSC 1.33.1 and extension v3.0 on my end. The previous bug was widespread and would happen for everyone. So any potential new bug would be unrelated to this issue as reported.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions