Open woffpost opened 1 month ago
@woffpost Can you clarify how exactly this is not working?
@samcx The route is not being intercepted; instead of processing the @modal/vacancy component, the regular vacancy component is processed.
I have the same issue using middleware rewrites and the examples found for Parallel Routes -> Modals
Next.js v15.0.3
When on the page domain.com/
and click a <Link href="/account" />
the modal opens and the app/@modal/(.)account/page.tsx
is rendered. (Works as intended)
When on the page foo.domain.com/
and click on a <Link href="/account" />
the modal does not open, and the app/%5Fws/account/page.tsx
is rendered instead. (Works not as intended)
// middleware.ts
[...]
export async function middleware(request: NextRequest) {
[...]
// Rewrite subdomain to workspace route
const { subdomain } = detectHost(requestHeaders);
if(subdomain) {
request.nextUrl.pathname = `/_ws/${removeSlashes(request.nextUrl.pathname)}`;
return NextResponse.rewrite(request.nextUrl, {
request: {
headers: requestHeaders,
},
});
}
return NextResponse.next({
request: {
headers: requestHeaders,
},
});
}
[...]
Verify canary release
Provide environment information
Which example does this report relate to?
https://github.com/vercel/nextgram
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Intercepting route does not work because the root goes through a rewrite
Expected Behavior
The intercepting route should work as specified in the documentation but through a rewrite.
To Reproduce