devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Widget Inspector shows nothing in widget tree (VS Code)

Open fraser-mendeco opened this issue 2 years ago • 9 comments

When debugging my application, nothing appears in the Widget Tree in the Widget Inspector (it is blank). The Refresh Tree button does nothing. The search button shows no results. Select Widget allows me to select something in the UI but still the inspector shows nothing. I have tried cleaning the project, reinstalling the dart and flutter extensions, and reinstalling VS Code entirely but to no avail.

All other devtools screens work as expected.

I have tried creating a new default flutter project and everything works as expected.

fraser-mendeco avatar Aug 19 '22 10:08 fraser-mendeco

CC @CoderDake

kenzieschmoll avatar Aug 19 '22 22:08 kenzieschmoll

Possible duplicate of #4397

fraser-mendeco avatar Sep 09 '22 08:09 fraser-mendeco

A few questions:

  • is there a single node in the summary widget tree (the one on the left) titled "[Root]" or is there nothing at all?
  • can you open the Inspector in the browser instead of the one that is embedded in VS Code, and then look in the chrome devtools console (right click + inspect) to see if there are any errors in the console?
  • if you open the widget details tree instead of the layout explorer on the right, do you see anything in that tree?

kenzieschmoll avatar Sep 13 '22 23:09 kenzieschmoll

  1. Nothing in the summary widget tree at all. It's completely blank.
  2. Error message in devtools console
main.dart.js:63732 
        
       ext.flutter.inspector.getRootWidgetSummaryTreeWithPreviews: (-32000) Server error
'package:flutter/src/foundation/stack_frame.dart': Failed assertion: line 205 pos 12: 'match != null': Expected #111    Eval.<anonymous closure>.getRootWidgetSummaryTreeWithPreviews () to match RegExp: pattern=^#(\d+) +(.+) \((.+?):?(\d+){0,1}:?(\d+){0,1}\)$ flags=.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      StackFrame.fromStackTraceLine (package:flutter/src/foundation/stack_frame.dart:205:12)
#3      MappedIterator.moveNext (dart:_internal/iterable.dart:391:20)
#4      WhereTypeIterator.moveNext (dart:_internal/iterable.dart:869:20)
#5      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#6      new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#7      new List.of (dart:core-patch/array_patch.dart:51:28)
#8      Iterable.toList (dart:core/iterable.dart:470:12)
#9      StackFrame.fromStackString (package:flutter/src/foundation/stack_frame.dart:93:10)
#10     StackFrame.fromStackTrace (package:flutter/src/foundation/stack_frame.dart:78:12)
#11     FlutterErrorDetails.debugFillProperties (package:flutter/src/foundation/assertions.dart:707:57)
#12     DiagnosticableNode.builder.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:2992:17)
#13     DiagnosticableNode.builder (package:flutter/src/foundation/diagnostics.dart:2995:8)
#14     _FlutterErrorDetailsNode.builder (package:flutter/src/foundation/assertions.dart:1285:56)
#15     DiagnosticableNode.emptyBodyDescription (package:flutter/src/foundation/diagnostics.dart:3006:77)
#16     DiagnosticsNode.toJsonMap.<anonymous closure> (package:flutter/src/foundation/diagnostics.dart:1612:13)
#17     DiagnosticsNode.toJsonMap (package:flutter/src/foundation/diagnostics.dart:1641:6)
#18     WidgetInspectorService._nodeToJson (package:flutter/src/widgets/widget_inspector.dart:1517:18)
#19     WidgetInspectorService._reportStructuredError (package:flutter/src/widgets/widget_inspector.dart:925:44)
#20     FlutterError.reportError (package:flutter/src/foundation/assertions.dart:1177:14)
#21     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:853:22)
<asynchronous suspension>

log @ main.dart.js:63732
  1. Widget tree view is also completely blank.

fraser-mendeco avatar Sep 14 '22 09:09 fraser-mendeco

what version of Flutter are you on?

kenzieschmoll avatar Sep 15 '22 16:09 kenzieschmoll

3.0.5

fraser-mendeco avatar Sep 15 '22 16:09 fraser-mendeco

I see a similar issue on my side (for only one of the projects I'm working on). I've added as much information as possible in the issue available here : https://github.com/flutter/flutter/issues/117054

Miiite avatar Dec 14 '22 13:12 Miiite

similar issue here, widget inspector is totaly empty in vscode, but work in Android studio with the same project

it happens a week or two ago when i switch back from beta channel where inspector also was buggy (inspector and widget tree was working but it was not showing corresponding line in dart file)

[✓] Flutter (Channel stable, 3.3.9, on macOS 13.1 22C65 darwin-arm, locale fr-FR) (dart 2.18.5 , devtool 2.15.0) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.74.1) [✓] Connected device (4 available) [✓] HTTP Host Availability

Edit : ios device or simulator, android device or simulator, have the exact same behavior for me

JulienSanfilippo avatar Dec 19 '22 10:12 JulienSanfilippo

I see a similar issue on my side (for only one of the projects I'm working on). I've added as much information as possible in the issue available here : flutter/flutter#117054

To try and give a bit more context, in my case, the widget inspector works just fine when I start it while debugging on my Android simulator. The issue seems to only appear when debugging with the iOS simulator.

Miiite avatar Dec 19 '22 13:12 Miiite