-
Notifications
You must be signed in to change notification settings - Fork 519
Live reload no longer works after Angular 6 update #1654
Comments
You might simply have an old |
Thanks! That was it! As to the why, because of this in
The description of
Maybe that should be inside a |
I am using server-side rendering. When debugging, I see this message: I had a snoop around the code and line 53 of Microsoft.AspNetCore.SpaServices.Extensions/AngularCli/AngularCliBuilder.cs wants to add Regardless, the workaround mentioned above does the trick, as long as there is a main.js in the dist-server directory. Even though whatever is watching does not update the file when changes are detected, the changes do come through to the browser. |
Glad you got a solution. As for built-in support for Angular 6, that's being tracked separately at aspnet/Templating#515 |
Hi, |
I was having the same problem but it wasn't due to the angular 6 upgrade. It occurred first in one project, then another.
My previous workaround was incorrect. The workaround is actually to delete the Dist folder |
This just killed half a day of productivity for me, thank you for pointing this out. Deleting the I implemented your suggestion with the following changes. I also had to add an public void ConfigureServices(IServiceCollection services)
{
...
ServiceProvider serviceProvider = services.BuildServiceProvider();
IHostingEnvironment env = serviceProvider.GetService<IHostingEnvironment>();
if (env.IsProduction())
{
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
}
...
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
if (env.IsProduction())
{
app.UseStaticFiles();
app.UseSpaStaticFiles();
}
...
} |
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
Fix startup by editing
package.json
to remove--extract-css
fromng serve
, resulting in: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.The text was updated successfully, but these errors were encountered: