From 96cae3819631dd52567aa78a3c7e08358d9e44c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Mon, 6 Apr 2026 01:48:25 +0100 Subject: [PATCH] fix(web): remove payload admin routes + withPayload (stabilize prod) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Payload CMS integration crashes the entire production app — the withPayload wrapper + admin routes break when DB tables don't exist and the layout conflicts with i18n routing. Keeping: payload.config.ts, blog/changelog pages with graceful DB fallback, static blog post page. Payload admin will be added back once properly integrated with a dedicated route group that doesn't inherit the main app layout. The blog post at /blog/peer-messaging-claude-code is static TSX and works without Payload runtime. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/next.config.ts | 3 +-- .../app/(payload)/admin/[[...segments]]/page.tsx | 14 -------------- apps/web/src/app/(payload)/admin/importMap.js | 2 -- apps/web/src/app/(payload)/layout.tsx | 14 -------------- 4 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 apps/web/src/app/(payload)/admin/[[...segments]]/page.tsx delete mode 100644 apps/web/src/app/(payload)/admin/importMap.js delete mode 100644 apps/web/src/app/(payload)/layout.tsx diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index 9bc4c29..8f83169 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -1,5 +1,4 @@ import type { NextConfig } from "next"; -import { withPayload } from "@payloadcms/next/withPayload"; import env from "./env.config"; @@ -116,4 +115,4 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: env.ANALYZE, }); -export default withPayload(withBundleAnalyzer(config)); +export default withBundleAnalyzer(config); diff --git a/apps/web/src/app/(payload)/admin/[[...segments]]/page.tsx b/apps/web/src/app/(payload)/admin/[[...segments]]/page.tsx deleted file mode 100644 index d72f5cd..0000000 --- a/apps/web/src/app/(payload)/admin/[[...segments]]/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck — Payload generates these types at build time -import { RootPage, generatePageMetadata } from "@payloadcms/next/views"; -import { importMap } from "../importMap"; -import config from "@payload-config"; - -type Args = { params: Promise<{ segments: string[] }> }; - -export const generateMetadata = ({ params }: Args) => - generatePageMetadata({ config, params }); - -export default function Page({ params }: Args) { - return ; -} diff --git a/apps/web/src/app/(payload)/admin/importMap.js b/apps/web/src/app/(payload)/admin/importMap.js deleted file mode 100644 index a7de53f..0000000 --- a/apps/web/src/app/(payload)/admin/importMap.js +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated by Payload — placeholder until first build -export const importMap = {}; diff --git a/apps/web/src/app/(payload)/layout.tsx b/apps/web/src/app/(payload)/layout.tsx deleted file mode 100644 index a6c57a3..0000000 --- a/apps/web/src/app/(payload)/layout.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import "@payloadcms/next/css"; -import type { ReactNode } from "react"; - -export const metadata = { - title: "Admin — claudemesh", -}; - -export default function PayloadLayout({ children }: { children: ReactNode }) { - return ( - - {children} - - ); -}