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

UseWebpackDevMiddleware HMR not routing #1121

Closed
jbomhold3 opened this issue Jul 16, 2017 · 1 comment
Closed

UseWebpackDevMiddleware HMR not routing #1121

jbomhold3 opened this issue Jul 16, 2017 · 1 comment

Comments

@jbomhold3
Copy link

Using 2.0.0-rtm-26339 the middleware for webpack dev isn't firing, and is going to default controller instead. env variable for dev is set

` app.UseStaticFiles();
app.UseAuthentication();

        JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
        loggerFactory.AddConsole(Config

if (env.IsDevelopment())
{

            app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
                HotModuleReplacement = true,
            });
            app.UseDeveloperExceptionPage();
            app.UseBrowserLink();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
        }
        
       
        app.UseMvc(routes =>
        {
            routes.MapSpaFallbackRoute(
               name: "spa-fallback",
               defaults: new { controller = "Home", action = "Index" });
            
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");

           
        });

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:5002/__webpack_hmr
Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler:Information: AuthenticationScheme: Cookies was successfully authenticated.
Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler:Information: AuthenticationScheme: OpenIdConnect was successfully authenticated.
Microsoft.AspNetCore.Authorization.DefaultAuthorizationService:Information: Authorization was successful for user: jbomhold3.
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker:Information: Executing action method WebApplicationBasic.Controllers.HomeController.Index (TownControl) with arguments ((null)) - ModelState is Valid
Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor:Information: Executing ViewResult, running view at path /Views/Home/Index.cshtml.
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker:Information: Executed action WebApplicationBasic.Controllers.HomeController.Index (TownControl) in 160.5755ms`

@SteveSandersonMS
Copy link
Member

SteveSandersonMS commented Jul 17, 2017

If you're updating to the next major version of Microsoft.AspNetCore.SpaServices, then you also need to update to the next major version of aspnet-webpack (i.e., 2.0.1).

If that doesn't fix it for you, could you please post repro steps based on starting a new project? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants