diff --git a/packages/next/src/server/lib/router-server.ts b/packages/next/src/server/lib/router-server.ts index 5fb97cace70b0e..1a01b6c12f4407 100644 --- a/packages/next/src/server/lib/router-server.ts +++ b/packages/next/src/server/lib/router-server.ts @@ -648,10 +648,10 @@ export async function initialize(opts: { }) if (opts.dev && developmentBundler && req.url) { - const { basePath, assetPrefix } = config + const { basePath } = config const isHMRRequest = req.url.startsWith( - ensureLeadingSlash(`${assetPrefix || basePath}/_next/webpack-hmr`) + ensureLeadingSlash(`${basePath}/_next/webpack-hmr`) ) // only handle HMR requests if the basePath in the request