-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom relative path assetPrefix breaks HMR #18080
Comments
Hi @fabb I experienced the same issue. As a work around, you can add the
|
In my case I cannot, because I have several next.js applications that I want to be able to run simultaneously in dev mode on localhost. |
I am getting same error in v10.2.3, curious any update on this issue? |
Bump |
Suddenly I found a workaround! Just add redirects: async redirects() {
return [
// @NOTE: "rewrites" breaks webpack-hmr, so we fix it here. See: https://github.com/vercel/next.js/issues/18080
{
source: '/:any*/_next/webpack-hmr:path*',
destination: '/_next/webpack-hmr:path*',
permanent: false,
},
];
}, |
fixed in #30632 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
We have several next.js applications on the same domain, so we want to prefix
_next
requests. This works both for development and production:The only thing that does not work are
webpack-hmr
calls. The calls will also be prefixed, but next.js returns a 404. Seems like therewrites
feature does not consider HMR calls.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
webpack-hmr
calls in the browser network tabExpected behavior
The
rewrites
feature should also rewrite HMR requests. In fact, doing the rewrites in a custom express server fixes HMR, so it should be possible.System information
Additional context
As mentioned here: #5602 (comment)
The text was updated successfully, but these errors were encountered: