[Turbopack]: Catch-all routes with nested parallel routes taking over all rendering for any route during r #78519
Labels
Dynamic Routes
Related to dynamic routes.
linear: turbopack
Confirmed issue that is tracked by the Turbopack team.
Middleware
Related to Next.js Middleware.
Parallel & Intercepting Routes
Related to Parallel and/or Intercepting routes.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/DrewLandgrave/turbopack-catch-all-parallel-bug
To Reproduce
Start the application (using turbo dev)
Navigate to localhost:3000/payment/test
The middleware is returning
NextResponse.rewrite('/payment/whoops')
Instead of the /payment/whoops/page.tsx page you will see the catch-all page
Start the application (using turbo dev)
Navigate to localhost:3000/payment/test?redirect3. The middleware is returning
NextResponse.redirect('/payment/whoops')
The url will change to /payment/whoops but the catch-all page is rendered
Instead of the /payment/whoops/page.tsx page you will see the catch-all page
Current vs. Expected behavior
Start the application (using turbo dev)
Navigate to localhost:3000/anotherRoute/test
The middleware is returning
NextResponse.rewrite('/anotherRoute/whoops')
You will see the whoops page with the /anotherRoute/test url
Start the application (using turbo dev)
Navigate to localhost:3000/anotherRoute/test?redirect
The middleware is returning
NextResponse.redirect('/anotherRoute/whoops')
You will see the whoops page with the /anotherRoute/whoops url
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 Available memory (MB): 32768 Available CPU cores: 12 Binaries: Node: 20.15.0 npm: 10.7.0 Yarn: N/A pnpm: 10.9.0 Relevant Packages: next: 15.3.1 // Latest available version is detected (15.3.1). eslint-config-next: N/A react: 19.1.0 react-dom: 19.1.0 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Dynamic Routes, Middleware, Parallel & Intercepting Routes, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
This all works fine with webpack. Only surfacing on Turbopack
https://www.loom.com/share/82a6d0f0899d409e8b9a4b03e9935c30?sid=cb16f696-55aa-417d-93b5-8e8fb5ff5170
The text was updated successfully, but these errors were encountered: