vercel / vercel/next.js

Wrong `error.tsx` matched using both parallel and dynamic routes

Open
#69,852 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Parallel & Intercepting Routes
Dominant language
JavaScript
Stars
142k
Forks
32.5k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/wonderful-dewdney-gp48mc

To Reproduce
  1. Start the dev server and open the preview: Home error and Slot error are shown correcly.
  2. Navigate to /page/one: two Home error are shown.
Current vs. Expected behavior
Current
  1. Start the dev server and open the preview: Home error and Slot error are shown correcly.
  2. Navigate to /page/one: two Home error are shown.
Expected
  1. Start the dev server and open the preview: Home error and Slot error are shown correcly.
  2. Navigate to /page/one: Home error and Slot error are shown correcly.
Provide environment information
Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.11.1
  npm: 10.2.4
  Yarn: 1.22.19
  pnpm: 8.15.4
Relevant Packages:
  next: 14.2.8 // Latest available version is detected (14.2.8).
  eslint-config-next: 14.2.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Parallel & Intercepting Routes

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and inspect the parallel and intercepting route setup around /page/one. Run both next dev and next start, then compare the rendered Home and Slot errors before and after navigating to that route. Done means /page/one shows one Home error and one Slot error, matching the initial preview.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.