-
Couldn't load subscription status.
- Fork 3k
Open
Labels
created-by: Contributorstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Describe the Bug
After #13962 (released in Payload v3.58.0), the RichText Lexical field crashes if prevValueRef.current is undefined. The component calls JSON.parse on an undefined value which results in:
Uncaught SyntaxError: "undefined" is not valid JSON
at JSON.parse (<anonymous>)
at Field.tsx:150:22This is reproducible with an empty RichText field and using the translator plugin to translate a document in payload >= 3.58.0.
Link to the code that reproduces this issue
https://github.com/r1tsuu/payload-enchants/tree/master/packages/translator
Reproduction Steps
- Install Payload ≥ 3.58.0 with @payloadcms/richtext-lexical.
- Add the Translator plugin by ritsu: https://github.com/r1tsuu/payload-enchants/tree/master/packages/translator
- Create a collection with a RichText (Lexical) field.
- Create a new document where this RichText field is empty.
- Trigger a translation that writes to the empty RichText field.
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
Binaries:
Node: 24.3.0
npm: 11.4.2
Yarn: N/A
pnpm: 10.12.4
Relevant Packages:
payload: 3.59.1
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
Available memory (MB): 24576
Available CPU cores: 14
Metadata
Metadata
Assignees
Labels
created-by: Contributorstatus: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet