payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
25.76k stars 1.64k forks source link

richtext-lexical (Table) - Expected CellNode to have a RowNode parent #7961

Closed rilrom closed 2 months ago

rilrom commented 2 months ago

Link to reproduction

No response

Environment Info

Binaries:
  Node: 20.16.0
  npm: 10.8.1
  Yarn: 1.22.22
  pnpm: 9.9.0
Relevant Packages:
  payload: 3.0.0-beta.95
  next: 15.0.0-canary.104
  @payloadcms/db-postgres: 3.0.0-beta.95
  @payloadcms/email-nodemailer: 3.0.0-beta.95
  @payloadcms/graphql: 3.0.0-beta.95
  @payloadcms/live-preview: 3.0.0-beta.95
  @payloadcms/live-preview-react: 3.0.0-beta.95
  @payloadcms/next/utilities: 3.0.0-beta.95
  @payloadcms/plugin-cloud: 3.0.0-beta.95
  @payloadcms/plugin-form-builder: 3.0.0-beta.95
  @payloadcms/plugin-nested-docs: 3.0.0-beta.95
  @payloadcms/plugin-redirects: 3.0.0-beta.95
  @payloadcms/plugin-seo: 3.0.0-beta.95
  @payloadcms/richtext-lexical: 3.0.0-beta.95
  @payloadcms/translations: 3.0.0-beta.95
  @payloadcms/ui/shared: 3.0.0-beta.95
  react: 19.0.0-rc-06d0b89e-20240801
  react-dom: 19.0.0-rc-06d0b89e-20240801
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Wed Mar 2 00:30:59 UTC 2022
  Available memory (MB): 25582
  Available CPU cores: 16

Describe the Bug

When selecting multiple cells in a richtext-lexical table and attempting to click the three dots, the following error occurs:

"Expected CellNode to have a RowNode parent"

Reproduction Steps

  1. Create a fresh repo using the reproduction guide.
  2. Add EXPERIMENTAL_TableFeature to @payloadcms/richtext-lexical.
  3. Add a table to rich text content.
  4. Select two cells.
  5. Attempt to click the three dots button.
  6. Error is shown.

Adapters and Plugins

db-postgres, richtext-lexical

rilrom commented 2 months ago

It looks like it could be related to this change.

invariant

From what I can tell invariant throws an error if the condition is false, but the change is throwing an error if the condition is true.

AlessioGr commented 2 months ago

Fixed by https://github.com/payloadcms/payload/pull/7964

github-actions[bot] commented 2 months ago

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