webpack hmr react-router exception server-side in production mode #1342

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

Originally created by @cveld on 10/3/2016

Steps to reproduce, following http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/

  • yo aspnetcore-spa (using version 0.3.4)
  • Choose the React redux template
  • set ASPNETCORE_ENVIRONMENT=Production
  • webpack --config webpack.config.vendor.js
  • webpack
  • dotnet run
  • Fetch http://localhost:5000 from a webbrowser

This will result in the following server-side exception:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
      An unhandled exception has occurred: Call to Node module failed with error: Error: The location '/__webpack_hmr' doesn't match any route configured in react-router.
at ClientApp\boot-server.js:1:802

How can I prevent this? Why is Webpack Hot Module Replacement kicking off in production mode - at least server-side?

*Originally created by @cveld on 10/3/2016* Steps to reproduce, following http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/ - `yo aspnetcore-spa` (using version 0.3.4) - Choose the React redux template - `set ASPNETCORE_ENVIRONMENT=Production` - `webpack --config webpack.config.vendor.js` - `webpack` - `dotnet run` - Fetch http://localhost:5000 from a webbrowser This will result in the following server-side exception: ``` fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0] An unhandled exception has occurred: Call to Node module failed with error: Error: The location '/__webpack_hmr' doesn't match any route configured in react-router. at ClientApp\boot-server.js:1:802 ``` How can I prevent this? Why is Webpack Hot Module Replacement kicking off in production mode - at least server-side?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1342
No description provided.