fix(web): upgrade next.js 16.0.10 → 16.2.2 (payload compat)
Payload CMS v3.81 withPayload() requires Next.js >=16.1.0 for production turbopack builds. Upgrade resolves the build failure. Reverts the dev-only withPayload workaround — now loads normally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
import type { NextConfig } from "next";
|
||||
import { withPayload } from "@payloadcms/next/withPayload";
|
||||
|
||||
import env from "./env.config";
|
||||
|
||||
// Payload CMS requires Next.js >=16.1.0 for production builds (turbopack).
|
||||
// Until we upgrade from 16.0.10, load withPayload only in dev where
|
||||
// turbopack isn't used for builds. Production serves blog/changelog
|
||||
// as static pages — Payload admin is dev-only for now.
|
||||
const withPayload =
|
||||
process.env.NODE_ENV === "production"
|
||||
? (c: NextConfig) => c
|
||||
: // eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
require("@payloadcms/next/withPayload").withPayload;
|
||||
|
||||
const INTERNAL_PACKAGES = [
|
||||
"@turbostarter/analytics-web",
|
||||
"@turbostarter/api",
|
||||
@@ -125,4 +116,4 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
||||
enabled: env.ANALYZE,
|
||||
});
|
||||
|
||||
export default withPayload(withBundleAnalyzer(config)) as NextConfig;
|
||||
export default withPayload(withBundleAnalyzer(config));
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
"marked": "16.4.1",
|
||||
"motion": "12.23.24",
|
||||
"negotiator": "1.0.0",
|
||||
"next": "16.0.10",
|
||||
"next": "16.2.2",
|
||||
"next-i18n-router": "5.5.5",
|
||||
"next-themes": "0.4.6",
|
||||
"nuqs": "2.7.2",
|
||||
|
||||
Reference in New Issue
Block a user