Repository navigation
Re-load assets when hot-reloading in a web browser #137265
Copy link
Copy link
Open
Labels
⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issueP1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-webWeb applications specificallyWeb applications specificallyt: hot reloadReloading code during "flutter run"Reloading code during "flutter run"team-webOwned by Web platform teamOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Update May 27, 2026
- When [web, tool] Support recompiling shaders and unify asset processing (2nd try) #186902 lands the following will support hot reload on the web
- Images
- JSON, Text, Data Files
Missing bits
- Fonts
- Shaders
Although these should work with hot restart
Use case
Hot-reload on the web doesn't reload assets. It would be great if we could improve the development cycle, since it could make working with shaders easier for Flutter web apps. It's probably not as common to edit images but this would be great to support too.
Steps to reproduce
- Create a flutter app with an image or shader asset
flutter:
uses-material-design: true
assets:
- assets/images/image.jpg
shaders:
- assets/shaders/visualizer.frag- Use the image or shader in
main.dart:
import 'package:flutter/material.dart';
void main() {
runApp(TestApp());
}
class TestApp extends StatelessWidget {
const TestApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Image.asset('assets/images/image.jpg'),
),
),
);
}
}- Run the app in a web browser
- Replace the image or update the shader
- Click hot restart in your IDE or press 'r' in the console
- Observe the image or shader doesn't change.
Proposal
Re-load assets when when hot-restarting in a web browser
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issueP1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: assetsPackaging, accessing, or using assetsPackaging, accessing, or using assetsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterplatform-webWeb applications specificallyWeb applications specificallyt: hot reloadReloading code during "flutter run"Reloading code during "flutter run"team-webOwned by Web platform teamOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
andrewkolos commentedon Nov 3, 2023
Some information on the cause of this:
During reload, the
ResidentRunnercallsupdateon itsDevFS, which would update the assets if their last modified time had become more recent1. However,WebResidentRunneruses its own implementationWebFS, which only copies assets during the first upload of the asset bundle to the device2.We could more or less copy-paste the relevant asset-updating code from the non-web
DevFSimplementation, but we may be better off by first doing some refactoring to avoid duplicate code.Footnotes
https://github.com/flutter/flutter/blob/a2e2574941982e3de3eb746f0a00ca90f6d28f04/packages/flutter_tools/lib/src/devfs.dart#L621 ↩
https://github.com/flutter/flutter/blob/01eef7ca13a9b69ecf16e172ae01b80ded66c053/packages/flutter_tools/lib/src/isolated/devfs_web.dart#L867-L874 ↩
flutter-triage-bot commentedon Nov 3, 2023
The
triaged-toollabel is irrelevant if there is noteam-toollabel orfyi-toollabel.[web, tool] Support recompiling shaders and unify asset processing
[web, tool] Support recompiling shaders and unify asset processing (f…
kevmoo commentedon May 20, 2026
Update May 20, 2026
Missing bits
Although these should work with hot restart
Reverts "[web, tool] Support recompiling shaders and unify asset proc…
[web, tool] Support recompiling shaders and unify asset processing (f…
Reverts "[web, tool] Support recompiling shaders and unify asset proc…
[-]Re-load assets when hot-restarting in a web browser[/-][+]Re-load assets when hot-reloading in a web browser[/+][web, tool] Support recompiling shaders and unify asset processing (2…
[web, tool] Support recompiling shaders and unify asset processing (f…
Reverts "[web, tool] Support recompiling shaders and unify asset proc…
[web, tool] Support recompiling shaders and unify asset processing (2…
flutter-triage-bot commentedon Sep 30, 2026
This issue is assigned to @kevmoo but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!