This repository was archived by the owner on Apr 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 518
HMR gets 404 on .hot-update.json #1191
Comments
I'm wondering if this is what's causing the |
Thanks for reporting this. It's now fixed. |
is there a quick workaround for this? |
@spnm , yes. You will need to change publicPath to something different for development build only. Assume you have isProduction variable then the code in your webpack.config will look like this: if (!isProduction) {
clientConfig.output.publicPath = "_/";
serverConfig.output.publicPath = "_/";
} I have a fully functional example/template here: |
This bug is not fixed. if (!isProduction) {
clientConfig.output.publicPath = "/_/";
serverConfig.output.publicPath = "/_/";
} |
Looks like this may be fixed in the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version: 2.0.0
When webpack configuration has publicPath = "/" (build everything to root) ConditionalProxyMiddleware fails to proxy requests to webpack-dev-server. In my case all requests to root (like http://localhost:5000/7d8b1be5454ed9e44b78.hot-update.json) fails with 404.
It was working fine for preview2 but does not work for new bits.
After reviewing/debugging your code I found that the following lines were added to ConditionalProxyMiddleware.cs:
then it actually fails when performing a check:
Here if
_pathPrefix
is "/" andcontext.Request.Path
= "/7d8b1be5454ed9e44b78.hot-update.json" thenStartsWithSegments
will return false.Interesting that pathPrefix in ctor is actually an empty string (passed from WebpackDevMiddleware). That is why it was working for previous (preview2) version.
The fix would be to skip inserting slash in case pathPrefix is an empty string. Or change the code of actual check in Invoke method.
Please let me know if you want me to submit a pull request.
The text was updated successfully, but these errors were encountered: