Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code debug <optimized out> with Flutter 3.10 / Dart 3.0

After latest "flutter upgrade" I'm having problems viewing some variables during debug in VS Code.

How can I view the contents of variables when hovering instead of getting this

Screenshot of hovering variable:
1

This only happens to some variables, others I can view the contents of as normal.

Flutter doctor output:

[✓] Flutter (Channel stable, 3.10.0, on macOS 13.2.1 22D68 darwin-arm64, locale
    en-SE)
    • Flutter version 3.10.0 on channel stable at
      /opt/homebrew/Caskroom/flutter/2.10.0/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (5 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version
    34.0.0-rc2)
    • Android SDK at /Users/niklaselelid/Library/Android/sdk
    • Platform android-33, build-tools 34.0.0-rc2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

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

[✓] Connected device (2 available)
    • iPhone 14 Pro Max (mobile) •
    • ios
    • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64 • macOS 13.2.1 22D68 darwin-arm64

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

I have looked for possible settings to configure the behavior. Without luck.

like image 307
swepilot Avatar asked Nov 17 '25 03:11

swepilot


1 Answers

Nothing wrong with your code. There's an issue with Dart SDK, which is not resolved yet. Please upvote it to get more attention from the Dart team.

like image 128
Andrey Gordeev Avatar answered Nov 18 '25 20:11

Andrey Gordeev