Services

Fix Next.js Draft Mode and CMS Preview Iframe Failures

Preview may technically exist, but editors cannot trust it when cookies, auth, iframe rules, or route handling keep breaking in practice.

Restore reliable draft mode and CMS preview flows so editors can review unpublished content without fighting cookies, auth, or iframe failures.

Short Answer

Preview is only useful if editors can trust it. When draft mode, cookies, auth, iframe rules, or route handling vary by environment, teams start approving content through workarounds instead of the platform. A reliable fix reproduces the CMS preview path properly, finds the failing boundary, and stabilises the content types editors use most.

Typical Symptoms

  • Editors cannot open preview routes reliably from the CMS.
  • Preview cookies, auth state, or iframe behaviour are inconsistent by environment.
  • Draft content preview works sometimes, but not predictably enough for editorial work.

Likely Causes

  • Preview entry points are not aligned with environment, auth, or cookie behaviour.
  • Draft mode is enabled inconsistently across routes or content types.
  • The CMS preview model was added without enough platformlevel guardrails.

What I Look at First

  • Reproduce preview from the CMS entry point across the affected environments and content types, not just from a copied URL.
  • Whether the failure is routespecific, environmentspecific, or iframespecific.
  • Which content types or page templates are affected first.

How I Help Fix This

  • Trace the failure to the route, auth, iframe, or cookie rule that is breaking preview.
  • Stabilise the preview path for the important content types first.
  • Roll out a preview flow that editors can trust.

When to Look at This

  • When preview is blocking editorial QA or delaying content release.
  • When the preview flow exists on paper but breaks often enough that teams work around it.

What Gets Resolved

  • Draft Mode, iframe preview, cookies, auth, and route handling work as one reliable editorial preview path.
  • Preview URLs set and clear draft state consistently across the environments editors use.
  • CMS iframe requests carry the required cookies and auth without exposing unpublished content on public routes.
  • Supported content types open the correct unpublished route and draft state from the CMS entry point.
  • Editors can review and approve changes without copied URLs, manual cookie steps, or other preview workarounds.

How This Usually Works

  1. Technical Diagnostic

    A focused review to establish what is happening, where the risk sits, and what should happen next, ending with a prioritised plan the team can take into delivery.

  2. Recovery Sprint

    A short, concentrated engagement to isolate a defined problem, stabilise the immediate situation, and move the first fixes into delivery.

Common Questions

Is this usually a CMS problem or a Next.js problem?
It can be either, but most failures sit at the join between them: preview URLs, cookies, auth state, iframe restrictions, or route handling that only breaks under editorial preview conditions.
Can you fix this without redesigning the whole preview model?
Usually yes. The first step is to stabilise the current preview flow for the important content types, then decide whether the wider preview architecture also needs to be simplified.

Reviewing your CMS setup?

Tell me what editors and developers need from the CMS, and what you want the current setup to handle better. I'll read it and suggest the next step.

Related Case Studies and Project Work

  1. Screenshot of the Nando’s website; part of John Kavanagh's selected project work.

    A Complete Migration and Replatform for Nando’s

    On Nando’s, headless content, Next.js rendering, Vercel deployment behaviour, and searchcritical local pages had to work as one system.

    View case study