payloadcms / payloadcms/payload
Errors on Admin during development from Next JS 16.3 with Cache Components Enabled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
When running Next JS 16.3 with cache components enabled, we get an error "Next.js encountered the unstable value Date.now() while prerendering". Recommended solutions from Next JS: https://nextjs.org/docs/messages/blocking-prerender-current-time#generate-on-every-request
@birdzai Adding
export const instant = falsewas not enough for me to get rid of the error.
I also needed to addawait connectionto the Pageimport { connection } from 'next/server' export const instant = false const Page = async ({ params, searchParams }: Args) => { await connection() return RootPage({ config, params, searchParams, importMap }) }Originally posted by @omaroskars in https://github.com/payloadcms/payload/issues/16020#issuecomment-5272483130
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
The issue does not identify a source file, test, or specific admin page. Start by reproducing the error with Next.js 16.3 and cache components enabled, then trace the affected admin page and its prerendering configuration. Done means the development admin loads without the unstable Date.now() error and the behavior is covered by an appropriate test or reproduction check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100