Skip to content

Bug: useSyncExternalStore missing getServerSnapshot in RSC with Lexical v0.37.0 #7934

Closed

Description

@nestarz

When using Lexical v0.37.0 with React Server Components (RSC), the following warning appears:

Missing getServerSnapshot, which is required for server-rendered content.

This occurs in @lexical/react/LexicalReactExtension.dev.mjs where useSyncExternalStore is called without the required getServerSnapshot function, causing hydration issues in RSC environments.

https://github.com/facebook/lexical/blob/5a4b131e78408c40564c6010a27c37ee91d10e46/packages/lexical-react/src/shared/useReactDecorators.tsx#L30

Steps to reproduce:

  1. Use Lexical v0.37.0 in a RSCapp.
  2. Render a Lexical editor or extension.
  3. Observe the warning in the console.

Expected behavior:
Lexical should provide a getServerSnapshot function to useSyncExternalStore to ensure compatibility with RSC.

Activity

  1. etrepum commented on Oct 20, 2025

    @etrepum
    Collaborator

    Want to submit a PR to fix it? getSnapshot should work for the third argument too.

  2. added a commit that references this issue on Oct 20, 2025
    489f3c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions