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
framework canvaskit cache is not being cleared with engine rolls #123737
Sayith @eyebrowsoffire "So the WebBuiltInAssets target always assumes that these are static and can be cached forever. But it now copies canvaskit over from the web sdk, which is not static forever."
I tried running a sample app on web flutter run -d chrome using latest master and main channels but still seeing below error:
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome... 20.0s
This app is linked to the debug service: ws://127.0.0.1:49414/M2WfAhbvFAY=/ws
Debug service listening on ws://127.0.0.1:49414/M2WfAhbvFAY=/ws
🔥 To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".
A Dart VM Service on Chrome is available at: http://127.0.0.1:49414/M2WfAhbvFAY=
Rejecting promise with error: Expected a value of type 'FontCollectionNamespace', but got one of type 'Null'
_js_helper.TypeErrorImpl.new
master version: Channel master, 3.9.0-22.0.pre.56, on macOS 12.2.1 21D62
main version: Channel main, 3.9.0-22.0.pre.56, on macOS 12.2.1 21D62
@eyebrowsoffire
No. After following #123794 (comment), I didn't get the said error, although earlier I thought that it was more of a workaround until this original issue gets fixed, so thought to report it here for your reference.
To give a more clear characterization of this bug:
Users who had the flutter repo checked out between #121902 and #123915 and used a web-based flutter tool command (such as flutter run -d chrome or flutter build web) will have stale canvaskit versions in their cache in an old location. Those artifacts confuse the web runner, and cause it to serve these stale versions of canvaskit. This, in turn, causes the user's application to crash when they run flutter run -d chrome with newer versions of the framework.
From what I can tell, none of the existing tags (3.6, 3.7, 3.8, 3.9 or 3.10) fall within the range between those two PRs, and do not load any of these stale artifacts in the cache. #124641 fixes the issue for anyone in that state. Otherwise, the workaround is to manually delete the bin/cache/canvaskit folder.
OK, the fairly short window to trigger the issue lowers the priority a bit, and its nice that there is a workaround. BUT when it fails, it fails in a way that is very hard to understand (I got JS interop issues), so I still think we should pick the fix if we think it's relatively low risk of causing regressions.
Reacted by Kevin Moore, Jackson Gardner and Francesco Iapicca
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
kevmoo commentedon Mar 31, 2023
@eyebrowsoffire – reports that this is NOT fixed - #123794 (comment)
eyebrowsoffire commentedon Apr 1, 2023
Re-opening due to further issues here. #123915 should fix it though.
darshankawar commentedon Apr 6, 2023
Hello @kevmoo and @eyebrowsoffire
I tried running a sample app on web
flutter run -d chromeusing latest master and main channels but still seeing below error:master version:
Channel master, 3.9.0-22.0.pre.56, on macOS 12.2.1 21D62main version:
Channel main, 3.9.0-22.0.pre.56, on macOS 12.2.1 21D62eyebrowsoffire commentedon Apr 6, 2023
@darshankawar I haven't been able to reproduce this on my end. Does this still reproduce after you clear the browser cache?
darshankawar commentedon Apr 10, 2023
@eyebrowsoffire
No. After following #123794 (comment), I didn't get the said error, although earlier I thought that it was more of a workaround until this original issue gets fixed, so thought to report it here for your reference.
mit-mit commentedon Apr 10, 2023
It looks like #123784 was closed as a dupe of the present issue, but I just hit it again in dart-lang/sdk#51998
I think we have to fix this for 3.10!
eyebrowsoffire commentedon Apr 12, 2023
After some digging, I was able to get my setup into a state that reproduced this problem, and I have put out a fix: #124641
eyebrowsoffire commentedon Apr 12, 2023
To give a more clear characterization of this bug:
Users who had the flutter repo checked out between #121902 and #123915 and used a web-based flutter tool command (such as
flutter run -d chromeorflutter build web) will have stale canvaskit versions in their cache in an old location. Those artifacts confuse the web runner, and cause it to serve these stale versions of canvaskit. This, in turn, causes the user's application to crash when they runflutter run -d chromewith newer versions of the framework.From what I can tell, none of the existing tags (3.6, 3.7, 3.8, 3.9 or 3.10) fall within the range between those two PRs, and do not load any of these stale artifacts in the cache. #124641 fixes the issue for anyone in that state. Otherwise, the workaround is to manually delete the
bin/cache/canvaskitfolder.mit-mit commentedon Apr 12, 2023
OK, the fairly short window to trigger the issue lowers the priority a bit, and its nice that there is a workaround. BUT when it fails, it fails in a way that is very hard to understand (I got JS interop issues), so I still think we should pick the fix if we think it's relatively low risk of causing regressions.
github-actions commentedon Apr 27, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.