Route group layout leaks into root `not-found` page
Open
@icyJoseph is already working on this.
Since Jul 30, 2026.
Not Found
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/lsvs/route-group-not-found-bug-reproduction
To Reproduce
- Start the app with
pnpm devorpnpm build && pnpm start. - Visit
/route-segment/error— the[slug]page callsnotFound() - Observe that the
not-foundpage is rendered inside the(route-group)layout.
Current vs. Expected behavior
Current: The not-found page is rendered inside the parent (route-group) layout.
Expected: Since there is no not-found page within that route group, Next.js falls back to the root not-found page, which should render only within the root layout.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Tue Apr 21 20:13:48 PDT 2026; root:xnu-11417.140.69.710.16~1/RELEASE_ARM64_T8112
Available memory (MB): 24576
Available CPU cores: 8
Binaries:
Node: 24.18.0
npm: 11.16.0
Yarn: N/A
pnpm: 11.17.0
Relevant Packages:
next: 16.3.0-preview.10 // Latest available version is detected (16.3.0-preview.10).
eslint-config-next: N/A
react: 19.2.8
react-dom: 19.2.8
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not Found
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
The layout hierarchy appears to be inconsistent:
/renders only the root layout./route-segmentrenders all three layouts./route-segment/error(which callsnotFound()) renders the root layout and the(route-group)layout, but not the nested route layout. ← the bug/route-segment/error/errorrenders only the root layout again.
This suggests the (route-group) layout leaks into the not-found boundary when notFound() is called.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.