Live reload no longer works after Angular 6 update #57

Closed
opened 2025-08-09 17:14:50 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @dstj on 5/22/2018

Live reloads no longer works after I updated a vanilla project to Angular 6 using instructions at https://update.angular.io/.

Do you know how to fix it?

To reproduce:

Using Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0

dotnet new angular -o UpgradeTest
cd UpgradeTest\ClientApp

npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli
ng update @angular/core

Fix startup by editing package.json to remove --extract-css from ng serve, resulting in:

    "start": "ng serve",
cd ..
dotnet run

C:\dev\scrap\UpgradeTest>dotnet run
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\dstj\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.AspNetCore.SpaServices[0]
      Starting @angular/cli on port 51362...
Hosting environment: Development
Content root path: C:\dev\scrap\UpgradeTest
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.SpaServices[0]
      > UpgradeTest@0.0.0 start C:\dev\scrap\UpgradeTest\ClientApp
> ng serve "--port" "51362"

** Angular Live Development Server is listening on localhost:51362, open your browser on http://localhost:51362/ **

Open http://localhost:5000 and then modify any HTML, live reload will not trigger. It appears that recompilation occurs, but the HTML is not updated in the browser.

Note: opening the Angular Live Development Server at http://localhost:51362 will live reload, but the backend does not work. That's why I believe this is a dotnet setup issue.

*Originally created by @dstj on 5/22/2018* Live reloads no longer works after I updated a vanilla project to Angular 6 using instructions at https://update.angular.io/. Do you know how to fix it? ## To reproduce: Using `Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0` ``` dotnet new angular -o UpgradeTest cd UpgradeTest\ClientApp npm install -g @angular/cli npm install @angular/cli ng update @angular/cli ng update @angular/core ``` Fix startup by editing `package.json` to remove `--extract-css` from `ng serve`, resulting in: ``` "start": "ng serve", ``` ``` cd .. dotnet run C:\dev\scrap\UpgradeTest>dotnet run info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] User profile is available. Using 'C:\Users\dstj\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest. info: Microsoft.AspNetCore.SpaServices[0] Starting @angular/cli on port 51362... Hosting environment: Development Content root path: C:\dev\scrap\UpgradeTest Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. info: Microsoft.AspNetCore.SpaServices[0] > UpgradeTest@0.0.0 start C:\dev\scrap\UpgradeTest\ClientApp > ng serve "--port" "51362" ** Angular Live Development Server is listening on localhost:51362, open your browser on http://localhost:51362/ ** ``` Open `http://localhost:5000` and then modify any HTML, live reload will not trigger. It appears that recompilation occurs, but the HTML is not updated in the browser. *Note:* opening the Angular Live Development Server at `http://localhost:51362` will live reload, but the backend does not work. That's why I believe this is a dotnet setup issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#57
No description provided.