Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zarko-tg opened this Issue Mar 7, 2019 · 22 comments

Comments

@zarko-tg
Copy link

zarko-tg commented Mar 7, 2019

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

@elricym

This comment has been minimized.

Copy link

elricym commented Mar 7, 2019

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

@DanTup

This comment has been minimized.

Copy link
Member

DanTup commented Mar 7, 2019

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.

@zarko-tg

This comment has been minimized.

Copy link
Author

zarko-tg commented Mar 7, 2019

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

@zarko-tg

This comment has been minimized.

Copy link
Author

zarko-tg commented Mar 7, 2019

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

This comment has been minimized.

Copy link

elricym commented Mar 7, 2019

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

@odonckers

This comment has been minimized.

Copy link

odonckers commented Mar 7, 2019

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.

@odonckers

This comment has been minimized.

Copy link

odonckers commented Mar 7, 2019

@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
    }
@priezz

This comment has been minimized.

Copy link

priezz commented Mar 8, 2019

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.

@JohnCido

This comment has been minimized.

Copy link

JohnCido commented Mar 8, 2019

@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

@rajeshzmoke

This comment has been minimized.

Copy link

rajeshzmoke commented Mar 8, 2019

Facing this issue after updating Vscode

screenshot 2019-03-08 at 12 33 24 pm

[✓] Flutter (Channel dev, v1.3.8, on Mac OS X 10.14.3 18D109, locale en-IN)
    • Flutter version 1.3.8 at /Users/rajeshkumar/Desktop/flutter
    • Framework revision e5b1ed7a7f (33 hours ago), 2019-03-06 14:23:37 -0800
    • Engine revision f4951df193
    • Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/rajeshkumar/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/rajeshkumar/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.0

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 25.0.1
    • Dart plugin version 173.4700

[✓] VS Code (version 1.32.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.24.0

[✓] Connected device (1 available)
    • HighPeaksw iPhone X • 76fd22d0d6fe8432a90a895351b60bd1d159e8ef • ios • iOS 12.1.4

• No issues found!

Cmd + Shift + Flutter: Hot restart Cmd + Shift + Flutter: Hot reload doesn't work

Capture logs

!! 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.1
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
    Loc: /Users/rajeshkumar/Desktop/flutter/bin/cache/dart-sdk
    Ver: 2.2.1-edge.571ea80e1101e706980ea8aefa7fc18a0c8ba2ec
Flutter SDK:
    Loc: /Users/rajeshkumar/Desktop/flutter
    Ver: 1.3.8
HTTP_PROXY: undefined
NO_PROXY: undefined

Fri Mar 08 2019 [12:39:37 GMT+0530 (IST)] Log file started
[12:39:37 GMT+0530 (IST)] [Analyzer] [Info] ==> {"id":"425","method":"analysis.setPriorityFiles","params":{"files":[]},"clientRequestTime":1552028977194}
[12:39:37 GMT+0530 (IST)] [Analyzer] [Info] <== {"id":"425"}
Fri Mar 08 2019 [12:39:44 GMT+0530 (IST)] Log file ended
@DanTup

This comment has been minimized.

Copy link
Member

DanTup commented Mar 8, 2019

Thanks for the info. I believe this is a bug I raised against VS Code during Insiders -> Microsoft/vscode#69534 I didn't notice at the time it had broken hot reload, but I do believe now the issues are related. There is an event vs.debug.onDidStartDebugSession that fires at the start of a debug session that we used to track sessions (required for hot reload and a few other things), however it's not firing anymore, and I suspect it's related to "undefined session received in acceptDebugSessionStarted" appearing in the dev console.

Please put a 👍 on that issue, and I'll see if I can find any workarounds. If you have the option, I would recommend downgrading VS Code until we know how to fix.

@DanTup DanTup changed the title Hot reload stopped working? Hot reload + Open Dev Tools stopped working in VS Code 1.32 Mar 8, 2019

@maheshmnj

This comment has been minimized.

Copy link

maheshmnj commented Mar 8, 2019

I couldn't see the loading indicator as well in case you guys want to roll back to 1.31 heres the link https://code.visualstudio.com/updates/v1_31

@DanTup DanTup pinned this issue Mar 8, 2019

@DanTup DanTup changed the title Hot reload + Open Dev Tools stopped working in VS Code 1.32 Hot reload + other debugging functionality stopped working in VS Code 1.32 Mar 8, 2019

@DanTup

This comment has been minimized.

Copy link
Member

DanTup commented Mar 8, 2019

The issue has been tracked down in VS Code and a fix landed. It's marked as a candidate for a recovery build. I'll close this issue once an update with the fix is released (in the meantime, stick on v1.31).

@DanTup

This comment has been minimized.

Copy link
Member

DanTup commented Mar 11, 2019

The Insiders build with this fix has gone out, so if you don't mind using VS Code Insiders, you can have 1.32 features without it breaking Flutter debugging :-)

@zarko-tg

This comment has been minimized.

Copy link
Author

zarko-tg commented Mar 11, 2019

Thanks @DanTup 👏
I can confirm VS Code Insiders 1.33.0 solves this issue.

@dev-aritra

This comment has been minimized.

Copy link

dev-aritra commented Mar 13, 2019

Yes, it's working in VS Code Insiders 1.33.0 and not in VS Code 1.32.1.

@zeh

This comment has been minimized.

Copy link

zeh commented Mar 13, 2019

VSC 1.32.2 has just been released and this error is fixed. Automatic hot reload on save works again, as do the dart devtools and all other flutter commands (toggle debug painting, etc).

I believe this issue can/should be closed.

@RazaGR

This comment has been minimized.

Copy link

RazaGR commented Mar 13, 2019

confirming, vscode 1.32.2 fixed this issue.

@mirkancal

This comment has been minimized.

Copy link

mirkancal commented Mar 14, 2019

confirming that vscode 1.32.2 fixed this issue.

@DanTup DanTup unpinned this issue Mar 14, 2019

@DanTup

This comment has been minimized.

Copy link
Member

DanTup commented Mar 14, 2019

Yep, this is all good now. Thanks! 👍

@DanTup DanTup closed this Mar 14, 2019

@brian-dunn

This comment has been minimized.

Copy link

brian-dunn commented Mar 15, 2019

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?

@nemoryoliver

This comment has been minimized.

Copy link

nemoryoliver commented Mar 16, 2019

Thanks a lot!! Works again with latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.