Lexical `upload` field breaks with multiple upload collections
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
- Create two upload collections
- Set lexical as default editor and add a
richTextfield - Open your dev console and start adding text and
/uploadelements to the editor, including navigating between upload collections and a mix of choosing existing and creating new uploads. - 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
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
Some example console output:
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!
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.