Skip to content

Crash when using richText type in cyclical collection #12760

Open
@Patrickroelofs

Description

@Patrickroelofs

Describe the Bug

A crash appears when a richText field type is used in multiple collections that reference each other, below I have included a diagram of my current situation, while this looks complicated this is entirely possible with other field-types except for richText.

Image

I hope this image helps identify the issue 💯

Link to the code that reproduces this issue

https://github.com/Patrickroelofs/payload-richtext-cycle

Reproduction Steps

  • Create a collection A (News)
  • Create a collection B (SharedBlocks)
  • Create a block with richText as a field
  • Create a block with a relationship to B (SharedBlocks) with the block above as an option
  • Collection A (news) should have both blocks
  • Collection B (SharedBlocks) should only have the RichText

This causes the error to appear, try the same without the richText field-type and it works.

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

area: core

Environment Info

Binaries:
  Node: 23.11.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A --> using pnpm but not reporting it
Relevant Packages:
  payload: 3.41.0
  next: 15.3.0
  @payloadcms/email-nodemailer: 3.41.0
  @payloadcms/graphql: 3.41.0
  @payloadcms/next/utilities: 3.41.0
  @payloadcms/payload-cloud: 3.41.0
  @payloadcms/richtext-lexical: 3.41.0
  @payloadcms/translations: 3.41.0
  @payloadcms/ui/shared: 3.41.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Enterprise
  Available memory (MB): 32066
  Available CPU cores: 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions