payloadcms / payloadcms/payload
Config returns null in production build (Next.js 16 + Turbopack RSC)
Open
@AlessioGr is already working on this.
Since Jan 30, 2026.
area: core
invalid-reproduction
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
PayloadCMS Config Returns null in Production Build (Next.js 16 + Turbopack)
Environment
- PayloadCMS: 3.73.0 (latest, with Next.js 16 support)
-
- Next.js: 16.2.0-canary.17 (meets
>16.1.1-canary.35 OR 16.2.0+requirement)
- Next.js: 16.2.0-canary.17 (meets
-
-
- React: 19.2.4
-
-
-
-
- Runtime: Bun 1.3.8 (also reproduced with Node 22)
-
-
-
-
-
-
- Database: PostgreSQL via
@payloadcms/db-postgres
- Database: PostgreSQL via
-
-
-
-
-
-
-
-
- Bundler: Turbopack (Next.js 16 default)
-
-
-
-
-
-
-
-
-
-
- Build Target: Docker production build
-
-
-
-
-
Summary
When running PayloadCMS in a Next.js 16 production build with Turbopack, the Payload config object returns null when imported in React Server Component context, specifically in the (payload)/layout.tsx file. This causes the admin panel to fail with an RSC error.
Error occurs ONLY:
Link to the code that reproduces this issue
N/A (Reproduction steps provided below)N/A (Reproduction steps provided below)
Reproduction Steps
See the 'Describe the Bug' section above for full reproduction details and code blocks.
Which area(s) are affected?
area: core
Environment Info
PayloadCMS: 3.73.0, Next.js: 16.2.0-canary.17, React: 19.2.4, Bun: 1.3.8, Bundler: Turbopack
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.