payload icon indicating copy to clipboard operation
payload copied to clipboard

Lexical `upload` field breaks with multiple upload collections

Open ssyberg opened this issue 2 years ago • 2 comments

Link to reproduction

No response

Describe the Bug

Seeing odd, admin breaking behavior that appears to be tied to multiple upload collections. There are a number of different errors that I've seen in the console but each one breaks admin or the lexical editor until page refresh/reload (and any work in progress is lost). One common experience is during create in the drawer, the drawer becomes unresponsive and when you close the drawer editor errors start cropping up.

To Reproduce

  1. Create two upload collections
  2. Set lexical as default editor and add a richText field
  3. Open your dev console and start adding text and /upload elements to the editor, including navigating between upload collections and a mix of choosing existing and creating new uploads.
  4. You should see Lexical start to throw errors and weird behavior in the editor rendering it unusable.

Payload Version

2.8.2

Adapters and Plugins

payloadcms/richtext-lexical

ssyberg avatar Jan 18 '24 17:01 ssyberg

If this does get worked on soon, I'd like to put in a good word for this feature request as it seems closely related ;) https://github.com/payloadcms/payload/discussions/4568

ssyberg avatar Jan 18 '24 17:01 ssyberg

Some example console output: image

ssyberg avatar Jan 18 '24 17:01 ssyberg

Hey @ssyberg I have just tried reproducing this in the 3.0.0-beta.37 and this does not happen anymore! I have recently fixed an issue which caused lexical to freeze if you created a new upload document within lexical from the document drawer, if that was a secondary uploads-enabled collection. I'm pretty sure this is related.

We also have an e2e test which ensures this works now: https://github.com/payloadcms/payload/blob/beta/test/fields/collections/Lexical/e2e/main/e2e.spec.ts#L361

If you encounter this again in 33.0.0-beta.37 or newer, please open a new issue and I'll look into it asap!

AlessioGr avatar May 29 '24 16:05 AlessioGr

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Sep 07 '24 03:09 github-actions[bot]