The issue involves complex routing behavior and inconsistent 404 handling in parallel routes.
The issue describes inconsistent 404 handling when navigating to non-existent pages within parallel routes. The problem requires understanding Next.js's routing system and debugging navigation behavior. The scope is somewhat clear but involves complex routing logic.
https://github.com/r4sheed/nextjs-parallel-routes-404-repro
Set up the project:
git clone https://github.com/r4sheed/nextjs-parallel-routes-404-repro.git
cd nextjs-parallel-routes-404-repro
Ensure you have the project files as structured. The key files for reproducing the bug are:
src/app/(main)/layout.tsx (defines the main layout with the parallel route slot)src/app/(main)/@breadcrumb/default.tsxsrc/app/(main)/@breadcrumb/[...catchAll]/page.tsx (provides the content for the breadcrumb slot)src/app/(main)/not-found.tsx (custom 404 page for the (main) group)src/app/page.tsx (root page with a link to a non-existent page)src/app/(main)/main-group-page/page.tsx (a page within the group, also with a link to a non-existent page)src/app/(main)/exists/page.tsx (another page within the group)Install dependencies:
npm install
Run the development server:
npm run dev
Open the application: Open http://localhost:3000 in your browser.
Test Scenario 1 (Correct 404):
/), you will see a "Go to a page that does not exist (from root)" link.src/app/(main)/not-found.tsx. The browser's network tools should show a 200 status for the navigation.Test Scenario 2 (Incorrect 200 OK):
/).Claim this issue to let others know you're working on it. You'll earn 30 points when you complete it!