You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New Version always displays notification to perform unnecessary Run 'pub get' #5549
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:
Open VSCode
Using menu, open a recent project.
Expected behavior
No pop up notification if the project is actually up to date.
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"
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.
@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.
@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.
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.
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.
@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?
@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:
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!
@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?
@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?
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.
@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!
@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!
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).
Activity
DanTup commentedon Jun 16, 2025
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.
DanTup commentedon Sep 17, 2025
Re-opening this as there's definitely still some issues here if you modify
pubspec.yamlin a way that doesn't affectpubspec.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.
longtimedeveloper commentedon Sep 17, 2025
@DanTup I deleted my
pubspec.lockfile and ranflutter 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.DanTup commentedon Sep 17, 2025
@longtimedeveloper you might need to delete both
pubspec.lockand the.dart_code/package_config.jsonfile (or runflutter cleanif it's a Flutter app).However, if you make any changes to
pubspec.yamlthat don't change the resolution (eg. just adding a comment), the issue will come back - which is what dart-lang/pub#4672 is tracking.longtimedeveloper commentedon Sep 17, 2025
@DanTup thank you for the clarification.
I deleted
pubspec.lockI don't have the
.dart_code/package_config.jsonfile in my project.I do have a
.dart_tool/package_config.jsonfile in my project.I ran
flutter cleanI ran
flutter pub getI 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!
DanTup commentedon Sep 17, 2025
Apologies, I typo'd the folder name - that was the one :)
Yep, and change to
pubspec.yaml(which modifies the timestamp on the file) that does not result in changes to the packages (eg.pubspec.lockand.dart_tool/package_config.jsondo not update) will unfortunately re-trigger the prompt.longtimedeveloper commentedon Sep 17, 2025
@DanTup thank you, and thanks again for your help.
Update pubspec.lock/package_config.json after running "pub get" as a …
longtimedeveloper commentedon Oct 26, 2025
@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.
DanTup commentedon Oct 26, 2025
@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:
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!
longtimedeveloper commentedon Oct 26, 2025
@DanTup thank you very much. Looking forward to v3.122!
DanTup commentedon Oct 28, 2025
@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?
longtimedeveloper commentedon Oct 28, 2025
@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?
DanTup commentedon Oct 28, 2025
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 getonce, 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 getbecause the timestamps have changed.longtimedeveloper commentedon Oct 28, 2025
@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!
DanTup commentedon Oct 28, 2025
np, thanks for confirming it's working :)
longtimedeveloper commentedon Nov 15, 2025
@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.
DanTup commentedon Nov 15, 2025
This still sounds like what was described a few comments up. Right now, there is still a bug in
Puband Dart-Code just has a workaround. That workaround requires that you accept the prompt, and let it runpub get, because it will then fix the timestamps.Running
pub getoutside 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).