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
[web] Support runtime content-hashed asset resolution in web_ui and un-hide --web-content-hash #193031
With physical static assets now content-hashed on disk during flutter build web --web-content-hash (#191915 / #191919), calls to load assets by raw unhashed key (rootBundle.load, rootBundle.loadString, vector_graphicsAssetBytesLoader, video_player_web, and DOM media plugins) encounter 404 errors on fresh browser caches because runtime code requests unhashed logical paths directly over the 'flutter/assets' platform channel or via ui_web.assetManager.getAssetUrl(key).
Additionally, serving asset manifests (AssetManifest.bin.json, FontManifest.json) with fixed unhashed filenames prevents web hosting configurations from caching assets/** with Cache-Control: immutable without complex no-cache carve-outs for manifests, shaders, and notices.
Scope & Requirements
Web Engine Runtime Asset Resolution (ui_web.AssetManager):
In engine/src/flutter/lib/web_ui/, teach ui_web.AssetManager to resolve raw logical keys (assets/data/config.json) to content-hashed paths synchronously via AssetManager.getAssetUrl(asset).
In initialization.dart, ingest the key-to-hash mapping during initializeEngineServices() (via _flutter.buildConfig or AssetManifest.bin.json) before user code executes.
Ensure resolution is idempotent for already-hashed DPR variants produced by AssetImage.
100% Asset Directory Immutability:
Remove exclusions in packages/flutter_tools/lib/src/web/content_hash.dart for shaders/, NOTICES, and NOTICES.Z, hashing them on disk along with AssetManifest.bin.json and FontManifest.json.
Pass manifest hashes via _flutter.buildConfig in flutter_bootstrap.js so all files under build/web/assets/ can be served with Cache-Control: max-age=31536000, immutable.
Un-hide --web-content-hash:
Remove hide: true from WebOptions.webContentHash in packages/flutter_tools/lib/src/web/web_options.dart once runtime resolution and manifest immutability pass browser integration verification.
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
feat(web): resolve raw asset keys via content-hashed manifests and un…
github-actions commentedon Oct 7, 2026
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.