payloadcms / payloadcms/payload
Paste content to lexical editor with CORS-protected images will create invalid document in database
Open
@AlessioGr is already working on this.
Since Nov 19, 2025.
plugin: richtext-lexical
status: verified
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
Pasting CORS-protected images into the Lexical editor on a collection with drafts enabled causes unhandled errors in PayloadCMS.
Link to the code that reproduces this issue
https://github.com/llaz00/payload-paste-image-bug
Reproduction Steps
- Create a project with a collection that has a rich text field using the Lexical editor.
- Enable drafts.
- Try to paste content containing CORS-protected images (e.g., I used this article: https://www.xataka.com/moviles/llevamos-anos-sufriendo-llamadas-spam-operadores-miraban-uno-ellos-fin-va-a-hacer-algo).
- A CORS error appears in the browser console; the Media dialog does not open, but the post can still be saved as a draft. This results in an invalid document in the database.
- Attempting to update any other field of the document using payload.update returns a ValidationError because the upload block ID within the rich text field is invalid.
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
Binaries:
Node: 20.13.1
npm: 10.5.2
Yarn: N/A
pnpm: 10.15.1
Relevant Packages:
payload: 3.64.0
next: 15.4.7
@payloadcms/db-mongodb: 3.64.0
@payloadcms/graphql: 3.64.0
@payloadcms/next/utilities: 3.64.0
@payloadcms/richtext-lexical: 3.64.0
@payloadcms/translations: 3.64.0
@payloadcms/ui/shared: 3.64.0
react: 19.1.0
react-dom: 19.1.0
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Available memory (MB): 16318
Available CPU cores: 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.