fix(web): fully remove withPayload + admin routes from prod
withPayload crashes ALL routes with React #130 in standalone output — even with admin page replaced by redirect. The wrapper injects a client-side ConfigProvider that fails hydration. Removed: withPayload wrapper, entire (payload) route group. Kept: payload.config.ts, migrations, blog/changelog server-side queries with graceful DB fallback. Payload admin runs on local dev only (add withPayload back in next.config when running pnpm dev). Production content via static TSX pages or future API-based publishing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const { withPayload } = require("@payloadcms/next/withPayload");
|
||||
|
||||
import env from "./env.config";
|
||||
|
||||
const INTERNAL_PACKAGES = [
|
||||
@@ -118,4 +115,4 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
||||
enabled: env.ANALYZE,
|
||||
});
|
||||
|
||||
export default withPayload(withBundleAnalyzer(config));
|
||||
export default withBundleAnalyzer(config);
|
||||
|
||||
Reference in New Issue
Block a user