Skip to content

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

@nestarz

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.

const decorators = useSyncExternalStore(subscribe, getSnapshot);

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions