From 575770e1420406a93a6f9bb2f34f92e92a4723a4 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Mon, 6 Apr 2026 15:45:55 +0200 Subject: [PATCH] fix(cms): import CSS from @payloadcms/next/css, use handleServerFunctions from layouts --- apps/cms/src/app/(payload)/layout.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/cms/src/app/(payload)/layout.tsx b/apps/cms/src/app/(payload)/layout.tsx index 4a56c52..7bc32ee 100644 --- a/apps/cms/src/app/(payload)/layout.tsx +++ b/apps/cms/src/app/(payload)/layout.tsx @@ -1,9 +1,11 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import type { ServerFunctionClient } from "payload"; - +import "@payloadcms/next/css"; import config from "@payload-config"; -import { RootLayout } from "@payloadcms/next/layouts"; +import { + RootLayout, + handleServerFunctions, +} from "@payloadcms/next/layouts"; import React from "react"; import { importMap } from "./importMap"; @@ -13,10 +15,9 @@ type Args = { children: React.ReactNode; }; -const serverFunction: ServerFunctionClient = async function (args) { +const serverFunction: typeof handleServerFunctions = async (args) => { "use server"; - const { default: payloadModule } = await import("payload"); - return payloadModule.handleServerFunctions({ ...args, config, importMap }); + return handleServerFunctions({ ...args, config, importMap }); }; const Layout = ({ children }: Args) => (