Skip to content

Flutter Widget Inspector does not render correctly, mostly a blank page #4855

Closed

Description

@lukehutch

Describe the bug

My Flutter Widget Inspector randomly broke a few weeks ago, and I haven't been able to figure out how to get it working again. It's either blank, or displays a few lines like this:

image

Workspace Environment
Dart Code extension: 3.77.20231116
Flutter extension: 3.77.20231101 (activated)

App: Visual Studio Code
App Host: desktop
Version: linux 1.84.2

Workspace type: Dart, Flutter (LSP) (Multiroot)

Dart (3.3.0-91.0.dev): /opt/flutter/bin/cache/dart-sdk
Flutter (3.17.0-0.0.pre): /opt/flutter (sdk gphone x86 64 (android-x64/android))

Output from 'dart info'

/opt/flutter/bin/cache/dart-sdk/bin/dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

Project info

  • sdk constraint: '>=3.1.5 <4.0.0'
  • dependencies: auto_size_text, boxy, cached_network_image, carousel_slider, collection, cross_file, cupertino_icons, device_info_plus, email_validator, exif, extended_image, flutter, flutter_cache_manager, flutter_email_sender, flutter_fgbg, flutter_image_utilities, flutter_localizations, flutter_persistent_value_notifier, flutter_reactive_value, flutter_svg, fluttertoast, geocoding, geolocator, getwidget, google_fonts, google_mlkit_face_detection, http, image_picker, intl, jiffy, line_awesome_flutter, logging, material_dialogs, package_info_plus, path_provider, persistent_bottom_nav_bar_v2, provider, random_string, routemaster, share_plus, shared_preferences, url_launcher
  • dev_dependencies: flutter_launcher_icons, flutter_lints, flutter_test, lints
  • elided dependencies: 11

Process info

Memory CPU Elapsed time Command line
525 MB 0.0% 1-04:50:32 dart --enable-vm-service=0 --pause_isolates_on_start --disable-dart-dev -DSILENT_VM_SERVICE=true --write-service-info=file:/vm.json --pause_isolates_on_exit --enable-asserts /main.dart
714 MB 0.0% 1-18:50:10 dart ../serverpod_cli.dart generate --watch
77 MB 0.0% 1-04:50:32 dart debug_adapter
75 MB 0.0% 3-04:10:13 dart devtools --machine --allow-embedding --port 9100
64 MB 0.0% 4-01:44:58 dart devtools --machine --allow-embedding --port 9101
2174 MB 0.4% 3-04:10:13 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.77.20231116
1480 MB 0.2% 2-00:32:28 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.77.20231116
94 MB 0.0% 4-01:44:58 flutter_tools.snapshot daemon
94 MB 0.0% 3-04:10:13 flutter_tools.snapshot daemon
74 MB 0.1% 51:18 flutter_tools.snapshot debug_adapter
170 MB 0.2% 51:18 flutter_tools.snapshot run --machine --start-paused -d emulator-5554 --devtools-server-address http:/ --target /main.dart
Output from 'flutter doctor'

/opt/flutter/bin/flutter doctor -v

[✓] Flutter (Channel beta, 3.17.0-0.0.pre, on Fedora Linux 38 (Workstation Edition) 6.5.10-200.fc38.x86_64, locale en_US.utf8)
    • Flutter version 3.17.0-0.0.pre on channel beta at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 0b591f2c82 (3 weeks ago), 2023-11-02 22:01:10 -0400
    • Engine revision dff66925dc
    • Dart version 3.3.0 (build 3.3.0-91.0.dev)
    • DevTools version 2.29.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-UpsideDownCake, build-tools 33.0.1
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6 (Fedora 16.0.6-3.fc38)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.8.0

[✓] Android Studio (version 2022.2)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 73.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.84.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.77.20231101

[✓] Connected device (3 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Linux (desktop)            • linux         • linux-x64      • Fedora Linux 38 (Workstation Edition) 6.5.10-200.fc38.x86_64
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Activity

  1. lukehutch commented on Nov 25, 2023

    @lukehutch
    Author

    flutter clean, uninstalling and reinstalling the Flutter VS Code extension, restarting VS Code -- nothing seems to solve this.

  2. DanTup commented on Nov 26, 2023

    @DanTup
    Member

    @lukehutch if you run the Open DevTools command and then choose to Open in Browser, do you see the same thing or does it only occur when it's embedded inside VS Code?

    randomly broke a few weeks ago,

    I see you're currently on beta 3.17 - are you able to see whether it occurs on current stable 3.16 (if not, that narrows things down a little).

    @kenzieschmoll I don't suppose you've seen anything like this before?

  3. added this to the v3.78.0 milestone on Nov 26, 2023
  4. added
    in devtoolsRelates to integration with Dart/Flutter DevTools
    on Nov 26, 2023
  5. changed the title [-]Flutter Widget Inspector is broken[/-] [+]Flutter Widget Inspector does not render correctly, mostly a blank page[/+] on Nov 26, 2023
  6. lukehutch commented on Nov 26, 2023

    @lukehutch
    Author

    @DanTup It's also broken on 3.16. However it does work in the Web browser, even with 3.17 (I didn't know using it in a browser was an option! Now I have a way to use this again..)

  7. lukehutch commented on Nov 26, 2023

    @lukehutch
    Author

    I do have a massive widget tree, so on the web browser view, it takes about 30 seconds to display anything. But waiting even longer than that on VS Code, nothing is shown (or occasionally, a partial render is shown, something like in the screenshot -- it varies).

    In other words, maybe there is a memory or time limit that is being hit?

  8. DanTup commented on Nov 27, 2023

    @DanTup
    Member

    Can you reproduce this on any public projects that I'd be able to do some testing with?

  9. added
    awaiting infoRequires more information from the customer to progress
    on Nov 27, 2023
  10. lukehutch commented on Nov 27, 2023

    @lukehutch
    Author

    I can reproduce this with this small reproducer project that I made for this bug: flutter/flutter#136642 (comment)

    image

    However, I doubt that the issue has anything to do with any particular Flutter project. The issue is probably due to something being corrupted in a config file or an installed package.

    Is there any form of debugging I can enable to get you some more info?

    I'd be OK giving you remote access to my machine, if you need it to debug this, but hopefully you can come up with some things I can try first.

    The above-linked project has a very small widget tree, so my theory in my previous comment that maybe this was happening because of the large widget tree is not actually the issue.

  11. DanTup commented on Nov 27, 2023

    @DanTup
    Member

    Thanks - could you confirm a few things:

    • Exact OS/version
    • Extact VS Code version (the output of code --status when you have this project open might be useful too)
    • Any errors in the console (Help -> Toggle Developer Tools -> Console) when you see this?
    • Does running code with code --disable-gpu make any difference? (close all Code windows before running this as I'm not sure if it re-uses existing processes)
    • Does resizing the window (either the whole VS Code window or the split pane to resize the frame) make any difference?

    Also - do you have any other machines you can test the same thing on? (seeing it on another machine might increase the odds I'll be able to reproduce it, and it'll likely be easier to debug on a machine set up to run everything from source). Thanks!

  12. DanTup commented on Nov 27, 2023

    @DanTup
    Member

    I thought those lines were part of the inspector, but actually I don't see those lines in my inspector - it looks like they might actually be the UI guidelines from the editor?

    Another thing to check - do you see any rendering issues if you open a markdown file and run the Markdown: Open Preview to Side command? I'm wondering if this is a VS Code issue more than a DevTools (or Dart-Code) issue.

  13. lukehutch commented on Nov 27, 2023

    @lukehutch
    Author

    Sometimes a light blue bar appears at the bottom of the widget inspector view:

    image

  14. lukehutch commented on Nov 27, 2023

    @lukehutch
    Author
    • Exact OS/version
    $ uname -a
    Linux fedora 6.5.10-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov  2 19:59:55 UTC 2023 x86_64 GNU/Linux
    • Extact VS Code version (the output of code --status when you have this project open might be useful too)
    $ code --version
    1.84.2
    1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
    x64
    
    $ code --status
    Version:          Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:50:47.800Z)
    OS Version:       Linux x64 6.5.10-200.fc38.x86_64
    CPUs:             AMD Ryzen 9 3950X 16-Core Processor (32 x 4245)
    Memory (System):  125.70GB (83.03GB free)
    Load (avg):       1, 2, 2
    VM:               0%
    Screen Reader:    no
    Process Argv:     . --crash-reporter-id 11879ce0-438e-429c-8d0c-4da9fd848f93
    GPU Status:       2d_canvas:                              enabled
                      canvas_oop_rasterization:               disabled_off
                      direct_rendering_display_compositor:    disabled_off_ok
                      gpu_compositing:                        enabled
                      multiple_raster_threads:                enabled_on
                      opengl:                                 enabled_on
                      rasterization:                          enabled
                      raw_draw:                               disabled_off_ok
                      video_decode:                           enabled
                      video_encode:                           disabled_software
                      vulkan:                                 disabled_off
                      webgl:                                  enabled
                      webgl2:                                 enabled
                      webgpu:                                 disabled_off
    
    CPU %	Mem MB	   PID	Process
        0	   129	3438540	code main
        0	     0	3438547	   zygote
        0	   257	3438582	     gpu-process
        0	     0	3438617	       broker
        0	     0	3438548	   zygote
        0	     0	3438550	     zygote
        0	   257	3449950	window [4] (Widget Inspector - click (Workspace) - Visual Studio Code)
        0	   129	3451827	window [5] (create_test_profiles.dart - click (Workspace) - Visual Studio Code)
        0	     0	3438587	   utility-network-service
        0	     0	3438678	shared-process
        0	     0	3438720	ptyHost
        0	     0	3452040	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
        0	     0	3832618	     /usr/bin/bash --init-file /usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
        0	   257	3451848	extensionHost [5]
        0	     0	3451948	     electron-nodejs (config.js )
        0	   901	3451957	     /opt/flutter/bin/cache/dart-sdk/bin/dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.77.20231116
        0	     0	3451971	     /opt/flutter/bin/cache/dart-sdk/bin/dart devtools --machine --allow-embedding
        0	     0	3452560	     electron-nodejs (/usr/share/code/code --ms-enable-electron-run-as-node /home/luke/.vscode/extensions/redhat.fabric8-analytics-0.7.3/dist/server.js --node-ipc --clientProcessId=3451848)
        0	     0	3451859	fileWatcher [5]
        0	   386	3832504	extensionHost [4]
        0	     0	3832544	     electron-nodejs (config.js )
        0	  1802	3832553	     /opt/flutter/bin/cache/dart-sdk/bin/dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.77.20231116
        0	     0	3832569	     /opt/flutter/bin/cache/dart-sdk/bin/dart devtools --machine --allow-embedding
        0	     0	3833283	     electron-nodejs (/usr/share/code/code --ms-enable-electron-run-as-node /home/luke/.vscode/extensions/redhat.fabric8-analytics-0.7.3/dist/server.js --node-ipc --clientProcessId=3832504)
        0	   129	3833310	     /usr/java/jdk-11/bin/java -Dfile.encoding=utf8 -jar /home/luke/.vscode/extensions/vscjava.vscode-gradle-3.13.4/lib/gradle-language-server.jar
        0	     0	3833454	     /usr/java/jdk-11/bin/java -Dfile.encoding=UTF-8 -classpath /home/luke/.vscode/extensions/vscjava.vscode-gradle-3.13.4/lib/gradle-server.jar com.github.badsyntax.gradle.GradleServer 45735
        0	   772	3833649	     /home/luke/.vscode/extensions/redhat.java-1.24.0-linux-x64/jre/17.0.8.1-linux-x86_64/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -DDetectVMInstallationsJob.disabled=true -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -Xlog:disable -javaagent:/home/luke/.vscode/extensions/redhat.java-1.24.0-linux-x64/lombok/lombok-1.18.30.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/luke/.config/Code/User/workspaceStorage/9a8af0226dd93409e27ac99b624ed091/redhat.java -Daether.dependencyCollector.impl=bf -jar /home/luke/.vscode/extensions/redhat.java-1.24.0-linux-x64/server/plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar -configuration /home/luke/.config/Code/User/globalStorage/redhat.java/1.24.0/config_linux -data /home/luke/.config/Code/User/workspaceStorage/9a8af0226dd93409e27ac99b624ed091/redhat.java/jdt_ws --stdio
        0	     0	3833727	     /home/luke/.vscode/extensions/ms-vscode.cpptools-1.18.5-linux-x64/bin/cpptools
        0	     0	3832514	fileWatcher [4]
    
    Workspace Stats: 
    |  Window (create_test_profiles.dart - click (Workspace) - Visual Studio Code)
    |  Window (Widget Inspector - click (Workspace) - Visual Studio Code)
    |    Folder (click_client): 48 files
    |      File types: dart(26) md(2) yaml(2) json(1) gitignore(1) lock(1)
    |      Conf files:
    |    Folder (click_server): 239 files
    |      File types: jpg(52) dart(44) yaml(32) tf(13) json(12) sql(8) sh(4)
    |                  csv(3) gitignore(2) md(2)
    |      Conf files: launch.json(1) dockerfile(1)
    |      Launch Configs: dart(2)
    |    Folder (serverpod): 2577 files
    |      File types: dart(905) yaml(285) md(88) json(88) lock(42) tf(41)
    |                  gitignore(28) sql(26) png(18) pgsql(15)
    |      Conf files: dockerfile(10) launch.json(6) github-actions(2)
    |                  settings.json(1) tasks.json(1) package.json(1)
    |                  tsconfig.json(1)
    |      Launch Configs: dart(71)
    |    Folder (serverpod): 2577 files
    |      File types: dart(905) yaml(285) md(88) json(88) lock(42) tf(41)
    |                  gitignore(28) sql(26) png(18) pgsql(15)
    |      Conf files: dockerfile(10) launch.json(6) github-actions(2)
    |                  settings.json(1) tasks.json(1) package.json(1)
    |                  tsconfig.json(1)
    |      Launch Configs: dart(71)
    |    Folder (click_flutter): 6800 files
    |      File types: class(578) dex(311) len(276) json(233) jar(192) xml(189)
    |                  bin(168) txt(160) flat(122) tab(100)
    |      Conf files: launch.json(1) settings.json(1) cmake(1)
    |      Launch Configs: dart(3)
    • Any errors in the console (Help -> Toggle Developer Tools -> Console) when you see this?

    OK, I think you hit the nail on the head... there are thousands of lines of shader compilation errors, like the following, and DevTools is brought to its knees by the amount of output:

    image

    • Does running code with code --disable-gpu make any difference? (close all Code windows before running this as I'm not sure if it re-uses existing processes)

    I closed all windows and re-opened with --disable-gpu. Now I see only a gray box in the place of the Widget Inspector:

    image

    These are the new errors in the DevTools console:

    image

    • Does resizing the window (either the whole VS Code window or the split pane to resize the frame) make any difference?

    No.

    Also - do you have any other machines you can test the same thing on? (seeing it on another machine might increase the odds I'll be able to reproduce it, and it'll likely be easier to debug on a machine set up to run everything from source). Thanks!

    I do have another machine, but I'll have to set it up with Flutter etc. It has a different GPU, so I suspect there won't be a problem on that machine. I'll wait on your response to the above before I go to the effort of setting up that machine.

  15. 11 remaining items

  16. removed this from the v3.78.0 milestone on Nov 28, 2023
  17. lukehutch commented on Dec 14, 2023

    @lukehutch
    Author

    This is broken again in Code Insiders:

    image

    Can we get some better error reporting on the console when the renderer fails?

  18. DanTup commented on Dec 14, 2023

    @DanTup
    Member

    @lukehutch when do you see this? I just tested in Insiders and although I couldn't repro it being completely broken, I did see it flash this colour (for around a second) when I stopped my debug session, before it rendered the "Disconnected" page:

    image

    Are you seeing it when you stop a session, or as soon as you try to load?

    Can we get some better error reporting on the console when the renderer fails?

    It's difficult to answer this. If errors occur, they should be shown in the console. If there are no errors and something just isn't rendering properly because of VS Code issues (or GPU issues, etc.) then it's probably not something we can detect. If we can figure out what's going wrong here, we can look at whether we could better detect those types of issues though.

  19. lukehutch commented on Dec 14, 2023

    @lukehutch
    Author

    It's as soon as the DevTools tab opens, and it just sits there doing nothing.

    Your screen is a darker shade of gray, which might be a theme difference, or (I think more likely) you are probably looking at something different.

    I actually forgot to check the JS console. I don't see the shader compilation errors there now, so maybe fixing that exposed a different issue.

    This is what I see in the DevTools JS console, which is not very helpful, because the JS is minified:

    image

    How do I catch the JS exception back in the Dart source code for Widget Inspector?

  20. DanTup commented on Dec 14, 2023

    @DanTup
    Member

    Your screen is a darker shade of gray, which might be a theme difference, or (I think more likely) you are probably looking at something different.

    Sorry I wasn't very clear - I see your shade of grey for a second or two before it then switches to the disconnect screen. Perhaps there's some background colour that's the shade of grey from your screenshot or something.

    Can you confirm the exact version of Flutter you're on and whether opening DevTools in the browser (from VS Code) works ok? That exception in the console certainly seems suspicious.

  21. lukehutch commented on Dec 14, 2023

    @lukehutch
    Author
    $ flutter --version
    Flutter 3.17.0-1.0.pre.3 • channel beta • https://github.com/flutter/flutter.git
    Framework • revision 12b47270b7 (2 weeks ago) • 2023-11-27 17:21:11 -0600
    Engine • revision dff66925dc
    Tools • Dart 3.3.0 (build 3.3.0-91.0.dev) • DevTools 2.29.0

    Yes, opening DevTools in the browser does work. (I forgot I could do that... thanks)

  22. DanTup commented on Feb 22, 2024

    @DanTup
    Member

    @lukehutch is this still happening? I just noticed this issue was open but marked as "Fixed in VS Code".

    I suspect if it's still broken that it's probably an upstream issue we can't fix here though.

  23. added
    awaiting infoRequires more information from the customer to progress
    and removed on Feb 22, 2024
  24. lukehutch commented on Feb 22, 2024

    @lukehutch
    Author

    Looks like it is fixed in the RedHat RPM release code-1.86.2-1707854644.el8.x86_64.

    Thanks -- I'll close this!

  25. DanTup commented on Feb 22, 2024

    @DanTup
    Member

    Great, thanks for confirming :)

  26. added and removed
    awaiting infoRequires more information from the customer to progress
    on Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions