Skip to content

Conditional fields and blocks not updating properly in production when using Live Preview #12689

Closed
@beease

Description

@beease

Describe the Bug

In production environment, when editing a large page with many blocks and Live Preview enabled, the admin UI gets stuck and does not update properly after adding or editing blocks.

More specifically:

  • The screen often shows an infinite loading spinner after adding a new block :
Image
  • Conditional fields (e.g., checkboxes showing/hiding fields) stop working — toggling them has no visible effect until a manual page reload.

In both case, refreshing the page makes the admin UI appear correctly.

Video:
In this video, I start with a light page, then duplicate some large content — which triggers both bugs:

Enregistrement.de.l.ecran.2025-06-05.a.12.00.30.mov

Additional context:

After extensive testing, the issue only appears when all 3 conditions are met:

  • Production environment
  • Live Preview enabled
  • Document size is large (~30KB or more)

When the request body is small (~10KB), everything works fine. The bigger the document, the more consistent the bug becomes.

Link to the code that reproduces this issue

No repo yet – bug is only reproducible in production (see comment below).

Reproduction Steps

  • Create a collection with layout blocks (rich text, nested fields, etc.).
  • Enable Live Preview.
  • Deploy in production (in my case: self hosted Docker + Nginx setup).
  • Edit a large document (with 30KB+ payload).
  • Add a new block or toggle a conditional checkbox.

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.40.0
  next: 15.3.3
  @payloadcms/db-mongodb: 3.40.0
  @payloadcms/db-postgres: 3.40.0
  @payloadcms/graphql: 3.40.0
  @payloadcms/live-preview: 3.40.0
  @payloadcms/live-preview-react: 3.40.0
  @payloadcms/next/utilities: 3.40.0
  @payloadcms/plugin-seo: 3.40.0
  @payloadcms/richtext-lexical: 3.40.0
  @payloadcms/translations: 3.40.0
  @payloadcms/ui/shared: 3.40.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06)
  Available memory (MB): 7953
  Available CPU cores: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions