Skip to content

Re-load assets when hot-reloading in a web browser #137265

Open

Description

@johnpryan

Update May 27, 2026

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

  1. 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
  1. 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'),
        ),
      ),
    );
  }
}
  1. Run the app in a web browser
  2. Replace the image or update the shader
  3. Click hot restart in your IDE or press 'r' in the console
  4. Observe the image or shader doesn't change.

Proposal

Re-load assets when when hot-restarting in a web browser

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    a: assetsPackaging, accessing, or using assets
    team-webOwned by Web platform team
    on Oct 27, 2023
  2. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Nov 2, 2023
  3. andrewkolos commented on Nov 3, 2023

    @andrewkolos
    Contributor

    Some information on the cause of this:

    During reload, the ResidentRunner calls update on its DevFS, which would update the assets if their last modified time had become more recent1. However, WebResidentRunner uses its own implementation WebFS, 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 DevFS implementation, but we may be better off by first doing some refactoring to avoid duplicate code.

    Footnotes

    1. https://github.com/flutter/flutter/blob/a2e2574941982e3de3eb746f0a00ca90f6d28f04/packages/flutter_tools/lib/src/devfs.dart#L621 ↩

    2. https://github.com/flutter/flutter/blob/01eef7ca13a9b69ecf16e172ae01b80ded66c053/packages/flutter_tools/lib/src/isolated/devfs_web.dart#L867-L874 ↩

  4. flutter-triage-bot commented on Nov 3, 2023

    @flutter-triage-bot

    The triaged-tool label is irrelevant if there is no team-tool label or fyi-tool label.

  5. added a commit that references this issue on Apr 25, 2026
    c4073d5
  6. self-assigned this
    on May 20, 2026
  7. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on May 20, 2026
  8. kevmoo commented on May 20, 2026

    @kevmoo
    Contributor

    Update May 20, 2026

    • As of f15c3a3 the following now support hot reload on the web
      • Images
      • JSON, Text, Data Files

    Missing bits

    • Fonts
    • Shaders

    Although these should work with hot restart

  9. changed the title [-]Re-load assets when hot-restarting in a web browser[/-] [+]Re-load assets when hot-reloading in a web browser[/+] on May 26, 2026
  10. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Sep 30, 2026
  11. flutter-triage-bot commented on Sep 30, 2026

    @flutter-triage-bot

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

⏳Bot is counting down the days until it unassigns the issueP1High-priority issues at the top of the work lista: assetsPackaging, accessing, or using assetsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterplatform-webWeb applications specificallyt: hot reloadReloading code during "flutter run"team-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions