HMR not working with Webpack 2.2.1 #805

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

Originally created by @xevantus on 4/24/2017

HMR returns a 404 error when used with Webpack 2.2.1.
The Webpack middleware path appears to be encoded, and is attempting to resolve to a relative path containing the absolute path.
http://localhost:49663/http%3A%2F%2Flocalhost%3A62132%2F__webpack_hmr instead of http://localhost:62132/__webpack_hmr

The issue appears to be in WebpackDevMiddleware.ts.
Changing const webpackHotMiddlewareOptions = '?path=' + encodeURIComponent(hmrClientEndpoint);
to const webpackHotMiddlewareOptions = '?path=' + hmrClientEndpoint; allows the path to resolve normally.

versions:
"aspnet-webpack": "1.0.28",
"aspnet-webpack-react": "1.0.5",
"webpack": "2.2.1"

*Originally created by @xevantus on 4/24/2017* HMR returns a 404 error when used with Webpack 2.2.1. The Webpack middleware path appears to be encoded, and is attempting to resolve to a relative path containing the absolute path. `http://localhost:49663/http%3A%2F%2Flocalhost%3A62132%2F__webpack_hmr` instead of `http://localhost:62132/__webpack_hmr` The issue appears to be in WebpackDevMiddleware.ts. Changing `const webpackHotMiddlewareOptions = '?path=' + encodeURIComponent(hmrClientEndpoint);` to `const webpackHotMiddlewareOptions = '?path=' + hmrClientEndpoint;` allows the path to resolve normally. versions: "aspnet-webpack": "1.0.28", "aspnet-webpack-react": "1.0.5", "webpack": "2.2.1"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#805
No description provided.