Async root layout breaks app when wrapped inside a Suspense boundary
Nobody has claimed this yet.
- 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://codesandbox.io/p/devbox/awesome-fermi-g8x5x2
To Reproduce
- Enable dynamicIO
- Move the async root layout into a Suspense
- Throw an error inside any page component (or use any of
notFound,unauthorized,forbiddenfunction)
Current vs. Expected behavior
current: the root layout is not properly loaded, with the following error displayed: 'The following tags are missing in the Root Layout: , .'
expected: it should load the root layout as if it wasn't wrapped inside a Suspense
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 12
Binaries:
Node: 22.13.1
npm: 10.9.2
Yarn: N/A
pnpm: 10.5.2
Relevant Packages:
next: 15.2.2-canary.0 // Latest available version is detected (15.2.2-canary.0).
eslint-config-next: 15.1.7
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
dynamicIO
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Normally I wouldn't put the root layout inside a Suspense, but it was the only way to silent the error 'A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it', caused by having dynamicIO = true.
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.
Research direction
Start with the linked CodeSandbox reproduction and its dynamicIO configuration, then trace how an async root layout behaves when placed inside a Suspense boundary. Exercise the error, notFound, unauthorized, and forbidden cases described in the report. Done means the root layout loads correctly without reporting missing and tags.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100