Skip to content

AddViteApp should auto-configure IsProxied = false or support HMR through the proxy #14470

@maddymontaquila

Description

@maddymontaquila

Is your feature request related to a problem?

When using AddViteApp with the default Aspire proxy enabled, Vite's Hot Module Replacement (HMR) websocket connection fails. The workaround is:

.WithEndpoint("http", endpoint =>
{
    endpoint.Port = 5173;
    endpoint.IsProxied = false;
})

This requires:

  1. Knowing that IsProxied = false exists
  2. Hardcoding Vite's default port (fragile — conflicts if another Vite app is running)
  3. Losing Aspire's request tracking for the frontend

Describe the solution you'd like

Option A: AddViteApp should set IsProxied = false by default, since HMR doesn't work through the proxy.

Option B: The Aspire proxy should support websocket passthrough for HMR.

Additional context

Discovered in a project using AddViteApp + WithPnpm() with a React 19 + Vite frontend on Aspire 13.2.0-preview.1. The app loads fine but HMR silently fails — file edits don't hot-reload — until IsProxied = false is explicitly configured. This pattern is undocumented and was found through trial and error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions