Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

UseProxyToSpaDevelopmentServer doesn't auto-refresh browser using an Aurelia ClientApp with HMR #1743

@chrisckc

Description

@chrisckc

I created a project using the latest dotnet new angular template and replaced the ClientApp folder with an Aurelia app created using the Aurelia CLI.
The command
au new
was ran inside the project folder to create a new ClientApp folder, the following options were used:
Name: ClientApp
Platform: Web
Bundler: Webpack

Startup.cs was modified to use spa.UseProxyToSpaDevelopmentServer:
//spa.UseAngularCliServer(npmScript: "start");
spa.UseProxyToSpaDevelopmentServer(baseUri: "http://localhost:8080");

When i run both
au run --watch
and
dotnet run
it works fine, i can edit a file in the Aurelia app and the browser refreshes automatically using a full page refresh.

However if i run
au run --watch --hmr
instead, the auto refresh no longer works, but still works if i visit the Aurelia app directly via http://localhost:8080 (still refreshes the whole page as there is only 1 module in the au new template) it just no longer works from the dotnet host on http://localhost:5000 or https://localhost:5001

I then checked to see if "Hot Module Replacement" worked in the Angular app which was created by the template by enabling it using the following guide:
https://github.com/angular/angular-cli/wiki/1-x-stories-configure-hmr
and edited startup.cs to use the angular url:
spa.UseProxyToSpaDevelopmentServer(baseUri: "http://localhost:4200");
It works fine, i can edit a file in the angular project and see that the page updates without a full page refresh.

I have not read enough about HMR to understand how it does what it does, but as both ClientApps are using Webpack hmr, i would have expected it to also work in Aurelia through the spa proxy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions