UseWebpackDevMiddleware HMR not routing #577

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

Originally created by @jbomhold3 on 7/16/2017

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`

*Originally created by @jbomhold3 on 7/16/2017* 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`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#577
No description provided.