diff --git a/packages/runtime/src/router/ejected/body/branches/next.ts b/packages/runtime/src/router/ejected/body/branches/next.ts index d20b433..1d5bab9 100644 --- a/packages/runtime/src/router/ejected/body/branches/next.ts +++ b/packages/runtime/src/router/ejected/body/branches/next.ts @@ -7,7 +7,7 @@ const renderNext = ({ internalPath, externalPath }: EjectedNextResponse) => (isDynamic(internalPath) ? ` next = (final_params) => - \`${internalPath + \`\${nextRequest.nextUrl.basePath || ""}${internalPath .replace(/\/(:[^/]*)/gm, (match, value) => { return match.replace(value, `\${final_params.${value.slice(1)}}`); }) @@ -20,7 +20,7 @@ next = (final_params) => ` : internalPath !== "//" && internalPath !== externalPath ? ` -next = "${internalPath}"; +next = \`\${nextRequest.nextUrl.basePath || ""}${internalPath}\`; ` : ` next = true;