Skip to content

New Version always displays notification to perform unnecessary Run 'pub get' #5549

Closed

Description

@longtimedeveloper

Describe the bug
Each time I open a Flutter project, the extension always displays a pop up notification that says, "Some packages are mission or out of date, would you like to get them now? Button: "Run 'pub get'". Even if I run flutter pub get command, then close VSCode, and then reopen the project, this pop up appears on project open, but shouldn't

To Reproduce
Steps to reproduce the behavior:

  1. Open VSCode
  2. Using menu, open a recent project.

Expected behavior
No pop up notification if the project is actually up to date.

Screenshots
Pop Up Notification

Please complete the following information:

Workspace Environment
Dart Code extension: 3.112.0
Flutter extension: 3.112.0 (not activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.100.3

Workspace type: Dart (LSP)
Workspace name: rock_shared

Dart (3.8.1): D:\flutter\bin\cache\dart-sdk
Flutter (3.32.3): D:\flutter (No device)

Output from 'dart info'

D:\flutter\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.8.1 (stable) (Wed May 28 00:47:25 2025 -0700) on "windows_x64"
  • on windows / "Windows 10 Pro" 10.0 (Build 19045)
  • locale is en-US

Project info

  • sdk constraint: '^3.8.1'
  • dependencies: json_annotation
  • dev_dependencies: build_runner, json_serializable, lints

Process info

Memory CPU Elapsed time Command line
22 MB -- dart.exe
486 MB -- dart.exe
90 MB -- dart.exe
99 MB -- dart.exe
39 MB -- dart.exe
381 MB -- dart.exe
90 MB -- dart.exe

Activity

  1. DanTup commented on Jun 16, 2025

    @DanTup
    Member

    I think you're hitting dart-lang/pub#4588. There was an optimization in Pub that skipped writing one file but not another, which resulted in the timestamps being out-of-sync and making it look like packages needed fetching.

    A fix was merged and will be included in a future Dart/Flutter SDK release.

  2. DanTup commented on Sep 17, 2025

    @DanTup
    Member

    Re-opening this as there's definitely still some issues here if you modify pubspec.yaml in a way that doesn't affect pubspec.lock/package_config.json.

    The fix will be in pub (dart-lang/pub#4672) but I want to make sure this is tracked and noted in release notes.

  3. reopened this on Sep 17, 2025
  4. added this to the v3.122.0 milestone on Sep 17, 2025
  5. added
    in commandsRelates to commands (usually invoked from the command Palette)
    and removed on Sep 17, 2025
  6. longtimedeveloper commented on Sep 17, 2025

    @longtimedeveloper
    Author

    @DanTup I deleted my pubspec.lock file and ran flutter pub get, then closed my app and reopened it. I'm still getting the notification. Not sure if this information helps. Thank you for your diligence.

  7. DanTup commented on Sep 17, 2025

    @DanTup
    Member

    @longtimedeveloper you might need to delete both pubspec.lock and the .dart_code/package_config.json file (or run flutter clean if it's a Flutter app).

    However, if you make any changes to pubspec.yaml that don't change the resolution (eg. just adding a comment), the issue will come back - which is what dart-lang/pub#4672 is tracking.

  8. longtimedeveloper commented on Sep 17, 2025

    @longtimedeveloper
    Author

    @DanTup thank you for the clarification.

    I deleted pubspec.lock
    I don't have the .dart_code/package_config.json file in my project.
    I do have a .dart_tool/package_config.json file in my project.
    I ran flutter clean
    I ran flutter pub get
    I closed the app
    I opened the app
    The notification did not show up.

    I then changed the version number and saved the file.
    I closed the app
    I opened the app
    The notification showed up again

    I assume changing the version number only, causes this issue to happen.

    Looking forward to issue resolution. Thank you!

  9. DanTup commented on Sep 17, 2025

    @DanTup
    Member

    I don't have the .dart_code/package_config.json file in my project.
    I do have a .dart_tool/package_config.json file in my project.

    Apologies, I typo'd the folder name - that was the one :)

    I assume changing the version number only, causes this issue to happen.

    Yep, and change to pubspec.yaml (which modifies the timestamp on the file) that does not result in changes to the packages (eg. pubspec.lock and .dart_tool/package_config.json do not update) will unfortunately re-trigger the prompt.

  10. longtimedeveloper commented on Sep 17, 2025

    @longtimedeveloper
    Author

    @DanTup thank you, and thanks again for your help.

  11. longtimedeveloper commented on Oct 26, 2025

    @longtimedeveloper
    Author

    @DanTup Each time I open a Flutter project, the extension always displays a pop up notification that says, "Some packages are mission or out of date, would you like to get them now?

    I am using version: 3.120.1

    I am still having to run, flutter clean, delete the pubspec.lock file and then run, flutter pub get.

    Is this the expected behavior after your recent check in?

    Maybe a new version has not been published yet?

    Thank you.

  12. DanTup commented on Oct 26, 2025

    @DanTup
    Member

    @longtimedeveloper the underlying issue is a bug in Pub, however last week I made a workaround for this. However, that workaround is only in the pre-release version of the extension so far, it is not yet in the stable release.

    You can switch to the pre-release versions of the extensions with these buttons in VS Code:

    Dart/Flutter pre-release versions

    Or you can wait for the stable release (which will likely be in the next week or so). If you still see the issue in the pre-release or after v3.122 releases, please do let me know!

  13. longtimedeveloper commented on Oct 26, 2025

    @longtimedeveloper
    Author

    @DanTup thank you very much. Looking forward to v3.122!

  14. DanTup commented on Oct 28, 2025

    @DanTup
    Member

    @longtimedeveloper I had a notification from a comment, but I don't see the comment here now.. did you delete it because you resolved the issue, or do you think there is still a problem?

  15. longtimedeveloper commented on Oct 28, 2025

    @longtimedeveloper
    Author

    @DanTup sorry. Yes, I deleted it. When I first tested the pre-release, it didn't work when I opened the project that I had changed the version in pubspec.yaml. So I changed the version again, close and reopened and it worked.

    Question: does the code that your fix provides, is this fix's code run when pubspec.yaml is changed, or does the fix run when the project is opened?

  16. DanTup commented on Oct 28, 2025

    @DanTup
    Member

    Question: does the code that your fix provides, is this fix's code run when pubspec.yaml is changed, or does the fix run when the project is opened?

    The workaround I added just fixes the timestamps on the files when you click the prompt to fetch packages. So you still need to click the button to trigger pub get once, but then it should not repeat the next time when nothing else has changed.

    If you modify the pubspec.yaml though, it will still re-run pub get because the timestamps have changed.

  17. longtimedeveloper commented on Oct 28, 2025

    @longtimedeveloper
    Author

    @DanTup thank you. Yes, pub get runs once on save as expected. Closing the app and reopening is back to normal without the toast asking about updating packages. THANK YOU!

  18. DanTup commented on Oct 28, 2025

    @DanTup
    Member

    np, thanks for confirming it's working :)

  19. longtimedeveloper commented on Nov 15, 2025

    @longtimedeveloper
    Author

    @DanTup this issue has returned since I have upgraded to Flutter latest and the latest of Dart Code.

    I updated my pubspec.yaml file by hand. I ran flutter pub get. Then when I reopened the project, the pop up appears.

    So, I ran flutter clean, deleted the pubspec.lock file, ran flutter pub get. Then closed the app and reopened the app. The pop up does not appear.

    Thank you for looking into this.

    Identifier dart-code.dart-code
    Version 3.123.20251113
    
    
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.38.1, on Microsoft Windows [Version 10.0.19045.6575], locale en-US)
    [√] Windows Version (10 Pro 64-bit, 22H2, 2009)
    [√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.20)
    [√] Connected device (3 available)
    [√] Network resources
    
    • No issues found!
    
  20. DanTup commented on Nov 15, 2025

    @DanTup
    Member

    I updated my pubspec.yaml file by hand. I ran flutter pub get. Then when I reopened the project, the pop up appears.

    This still sounds like what was described a few comments up. Right now, there is still a bug in Pub and Dart-Code just has a workaround. That workaround requires that you accept the prompt, and let it run pub get, because it will then fix the timestamps.

    Running pub get outside of Dart-Code does not fix the timestamps, so Dart-Code may still prompt you to run. Until a proper fix in Pub rolls out, you should accept the Dart-Code prompt when you see it, and then it should disappear and not appear again (until you modify pubspec again).

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

    in commandsRelates to commands (usually invoked from the command Palette)is bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions