Skip to content

Hot reload requests should have a common path #192433

Closed

Description

@Wdestroier

Steps to reproduce

I'm running the app behind a reverse proxy, but there is no common prefix to redirect requests. Previously /dart-sdk/ existed, but apparently it was removed around 2 stable versions ago nvm it still exists, but it's not a common prefix. I added this rule for the latest version:

    # Proxy rule for hot reload requests to Flutter base path.
    - target: "http://127.0.0.1:3000/"
      prefix: "/packages/flutter_app"
      replace: "/f/packages/flutter_app"

However it's not enough, because requests made to https://localhost:5173/web_entrypoint.dart.lib.js are failing too.

Expected results

I expect Flutter to retrieve the path from index.html: <base href="/f/"> and make requests to https://localhost:5173/f/web_entrypoint.dart.lib.js. Should work with --web-defines too. That way the reverse proxy would still work, because all requests made to /f/** are already redirected to localhost:${flutterPort}. Flutter can have more integration tests for reverse proxies in development mode (related to hot reload).

Actual results

The reverse proxy - and consequently hot reload - breaks on every new version, because the path always changes, generating errors such as:

Failed to load resource: the server responded with a status of 404 (Not Found)
f/#/d/19/assets:1 Refused to execute script from 'https://localhost:5173/web_entrypoint.dart.lib.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
web_plugin_registrant.dart.lib.js:1  Failed to load resource: the server responded with a status of 404 (Not Found)
f/#/d/19/assets:1 Refused to execute script from 'https://localhost:5173/web_plugin_registrant.dart.lib.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

Code sample

Any existing Flutter sample app (that runs on the web) should work.

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
C:\Users\Wdest>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.47.2, on Microsoft Windows [versÆo 10.0.26200.9168], locale pt-BR)
[√] Windows Version (Windows 11 or higher, 25H2, 2009)
[X] Android toolchain - develop for Android devices
    X cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from
      https://developer.android.com/studio#command-line-tools-only and make sure to set the
      ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.8.3)
[√] Connected device (3 available)
[√] Network resources

! Doctor found issues in 1 category.

C:\Users\Wdest>

Activity

  1. suryaKommana2662 commented on Sep 9, 2026

    @suryaKommana2662
    Contributor

    @Wdestroier Thanks for the report. The issue appears to be specific to Flutter Web hot reload request handling when the application is served behind a reverse proxy. Routing this to team-web for further investigation.

  2. added
    t: hot reloadReloading code during "flutter run"
    platform-webWeb applications specifically
    team-webOwned by Web platform team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 9, 2026
  3. github-actions commented on Oct 16, 2026

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

assigned for triageissue is assigned to a domain expert for further triageplatform-webWeb applications specificallyt: hot reloadReloading code during "flutter run"team-webOwned by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions