Skip to content

Error when using RichTextField. #764

Answered by jonasnobile
kausik10 asked this question in Support
Discussion options

You must be logged in to vote

Hi! Yes — this kind of error (useSlateStatic must be used inside <Slate>) almost always comes from a version mismatch between slate, slate-react, and @contember/react-slate-editor.

Even if your package.json lists compatible versions, it’s still possible that multiple versions of slate or slate-react are installed due to transitive dependencies. That breaks the shared React context used by Slate.

Step 1: Check what's actually installed

  • Yarn:

    yarn why slate
    yarn why slate-react
  • npm:

    npm ls slate
    npm ls slate-react
  • pnpm:

    pnpm why slate
    pnpm why slate-react

Look for:

  • Which versions are installed
  • Whether more than one version is present
  • Which packages are introducing each version

Ste…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kausik10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants