Repository navigation
framework canvaskit cache is not being cleared with engine rolls #123737
Description
Activity
- addedtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.platform-webWeb applications specificallyWeb applications specifically
on Mar 30, 2023 @eyebrowsoffire – reports that this is NOT fixed - #123794 (comment)
Re-opening due to further issues here. #123915 should fix it though.
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: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.newmaster 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 21D62Reacted by Francesco Iapicca@darshankawar I haven't been able to reproduce this on my end. Does this still reproduce after you clear the browser cache?
@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.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!
Reacted by Kevin MooreAfter some digging, I was able to get my setup into a state that reproduced this problem, and I have put out a fix: #124641
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.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- addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Apr 13, 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.- locked as resolved and limited conversation to collaborators
on Apr 27, 2023 - addedP0Critical issues such as a build break or regressionCritical issues such as a build break or regressionand removed
on Jun 28, 2023
Sayith @eyebrowsoffire "So the
WebBuiltInAssetstarget 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."