Skip to content

VS Code shows ENOTDIR errors and Run/F5 does not work, while running from terminal works. #5957

Closed

Description

@moelhewehy7

Issue Type

Bug

Summary

VS Code shows ENOTDIR errors and Run/F5 does not work, while running from terminal works.

Error

ENOTDIR: not a directory, stat '/Users/al-almiyaal-hura/FlutterApps/manasa/lib/main.dart/pubspec.yaml'

What I expected

F5 / Run button should launch Flutter app.

What happens

Terminal commands work (flutter run), but VS Code Run/F5 fails.

Environment

  • OS: macOS
  • VS Code: (Help > About, paste version)
  • Flutter extension: (paste version)
  • Dart extension: (paste version)

Repro steps

  1. Open Flutter project.
  2. Press F5 or click Run button.
  3. VS Code fails with ENOTDIR and app does not launch.

Notes

I previously changed many VS Code paths/settings and did a reset, but issue still persists globally.

Activity

  1. ArsalanJawed209 commented on Mar 4, 2026

    @ArsalanJawed209

    Confirmed. Downgrading from v3.130.0 to v3.128.0 fixes the issue.
    The extension incorrectly constructs the path as lib/main.dart/pubspec.yaml — treating the entry point file as a directory when launching via Run/F5.
    Workaround: Downgrade Dart extension to v3.128.0 and disable Auto Update until a fix is released.
    Environment:

    Dart extension: 3.130.0 (broken), 3.128.0 (works)

  2. moelhewehy7 commented on Mar 4, 2026

    @moelhewehy7
    Author

    Thank You bro , its working

  3. kgorynin commented on Mar 4, 2026

    @kgorynin

    +1 faced same issue

  4. FMorschel commented on Mar 4, 2026

    @FMorschel
    Contributor
  5. DanTup commented on Mar 4, 2026

    @DanTup
    Member

    Yep, this issue is being tracked in #5954

    I've published a new pre-release extension with a possible fix for this - since I'm unable to repro on any platform, is someone able to try it out and confirm if it solves the issue?

    You can switch to the pre-release version with this button in VS Code. The version should be v3.131.20260304 and you'll need to click the Restart button after it installs.

    Dart pre-release versions

    If someone confirms the fix works, I'll cherry-pick this into a stable release. Thanks!

  6. added this to the v3.130.1 milestone on Mar 4, 2026
  7. DanTup commented on Mar 4, 2026

    @DanTup
    Member

    I've published a new stable build with this fix in it to both VS Code + OpenVSX. The fix is in:

    • v3.130.1 stable
    • v3.131.20260304 pre-release

    It might take 10-20 mins for the stable version to show up, but the pre-release is already up. You will need to click the "Restart" button alongside the extension (or reload VS Code) for the new version to be loaded after installation.

    Sorry for the inconvenience - I'm still not sure why the issue only occurs for some people (and not on my bots, or Win/Mac/Ubuntu locally) but it should be fully resolved now.

    Thank you for helping me track it down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    importantSomething important!in flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions