techvx · GitHub

Quite similar to #4932, yet with a slightly less verbose of an output this time around.

Describe the bug
Any attempt to execute an expression in VS Code's debug console for a Flutter app running in debug mode prints back:

2 + 2
Unable to find the library for file:///e%3A/Development/_code/Flutter/app_6/lib/main.dart

To Reproduce
Steps to reproduce the behavior:

  1. Create a new app via "Flutter: New Project".
  2. Build it for any platform - Windows or Web.
  3. Evaluate a 2 + 2 in the VSC debug console.

Expected behavior
Having the debug console matching the output of the Flutter DevTools one.

Screenshots

image

image

Workspace Environment
Dart Code extension: 3.86.0
Flutter extension: 3.86.0 (activated)
App: Visual Studio Code
App Host: desktop
Version: win 1.88.1
Workspace type: Flutter (LSP)
Dart (3.3.3): <flutter install dir>\bin\cache\dart-sdk
Flutter (3.19.5): <flutter install dir>
Output from 'dart info'

<flutter install dir>\bin\cache\dart-sdk\bin\dart.exe 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

  • Dart 3.3.3 (stable) (Tue Mar 26 14:21:33 2024 +0000) on "windows_x64"
  • on windows / "Windows 10 Pro" 10.0 (Build 19045)
  • locale is en-US

Project info

  • sdk constraint: '>=3.3.3 <4.0.0'
  • dependencies: cupertino_icons, flutter
  • dev_dependencies: flutter_lints, flutter_test
  • elided dependencies: 1

Process info

Memory CPU Elapsed time Command line
47 MB -- dart.exe
147 MB -- dart.exe
77 MB -- dart.exe
86 MB -- dart.exe
151 MB -- dart.exe
95 MB -- dart.exe
Output from 'flutter doctor'

<flutter install dir>\bin\flutter.bat doctor -v

[✓] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.19045.4291], locale en-US)
    • Flutter version 3.19.5 on channel stable at <flutter install dir>
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (4 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at E:\Programs\AndroidSDK
    • Platform android-33, build-tools 30.0.3
    • Java binary at: E:\Programs\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
    • All Android licenses accepted.
[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.21)
    • Visual Studio at E:\Development\VS\Community
    • Visual Studio Community 2019 version 16.11.33027.164
    • Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 4.2)
    • Android Studio at E:\Programs\Android Studio
    • 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
    • android-studio-dir = E:\Programs\Android Studio
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4291]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 123.0.6312.123
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 124.0.2478.51
[✓] Network resources
    • All expected network resources are available.
• No issues found!

@DanTup

Read the original on github.com ↗