payloadcms / payloadcms/payload

Warn at startup when the installed Next.js version is outside Payload's supported peer range

Open
#17,119 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Summary

Payload declares a Next.js peer dependency but does not enforce it at runtime, so installing an unsupported Next version (one in the 16.0.0 to 16.2.5 gap) produces a cryptic admin failure with no hint that the Next version is the cause. A clear startup warning would turn an opaque debugging session into a one line fix.

What happened

  • App on payload@3.85.1 and @payloadcms/next@3.85.1 with next@16.2.1.
  • @payloadcms/next@3.85.1 declares the next peer as >=15.2.9 <15.3.0 || >=15.3.9 <15.4.0 || >=15.4.11 <15.5.0 || >=16.2.6 <17.0.0, which excludes 16.0.0 to 16.2.5.
  • pnpm printed an unmet peer warning at install (easy to miss) and installed 16.2.1 anyway.
  • The admin panel then rendered a generic "This page could not be found" after login. Nothing pointed at the Next version. Downgrading to a supported version (15.4.11) fixed it instantly.

Current behavior

No startup or build check compares the installed next against the declared peer range. The only version aware message is the Turbopack specific one reworded in #14873.

Proposed behavior

At admin or app startup, compare the resolved next version against the declared peer range. If it falls outside, log a clear, actionable message such as

Payload requires Next.js ">=16.2.6 <17" (or a supported 15.x range). Found 16.2.1, which is unsupported and may contain unpatched security advisories.

Since 16.2.6 was floored for security reasons (#16537), naming the security angle helps users prioritize the upgrade.

Why existing issues do not cover this

  • #15429 (config returns null, Next 16 plus Turbopack) is Turbopack and config resolution specific.
  • #16288 (suppressHydrationWarning on 16.2.x) is a distinct hydration behavior.
  • #14873 only reworded an existing Turbopack error. There is no general peer version check.

Environment

payload 3.85.1, @payloadcms/next 3.85.1, next 16.2.1 (broken) then 15.4.11 (working), Node 23, pnpm.


Suggested labels: enhancement, area: next-payload

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

Read the @payloadcms/next peer-dependency declaration and locate the admin or app startup entry point that can resolve the installed Next.js version. Add coverage for supported and unsupported ranges; done when an unsupported version produces an actionable warning and supported versions do not.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, typescript
Domain
backend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.