Next.js Discord

Discord Forum

Changes to Payload Content Only Visible After Redeployment

Unanswered
VoidPointer posted this in #help-forum
Open in Discord
I have just got a small website going using Payload CMS, and everything is working great locally but when I deploy to either Firebase or to Vercel, I find that changed I made to content are only visible in the front end after I trigger a new deployment. Gemini suggests this is somehow because for production builds only content that is fetched at build time is included. It also suggested I try this "force-dynamic" but this has changed nothing
export const dynamic = "force-dynamic";
export async function Home() {
  const payload = await getPayload({ config: configPromise });
  const settings: HomepageSetting = await payload.findGlobal({
    slug: "homepage-settings",
    draft: false,
  });
  return <HomeClient settings={settings} />;
}

In this case, the home route renders the above component, and HomepageSetting is a global containing the English and Chinese headings to use on the home page. My client wants both at the same time instead of the user choosing a language so I haven't gone down the multi-langauge road yet. Even if one language though, I'm losing everything a CMS adds as soon as I deploy.

0 Replies