Like what we’re doing? Star us on GitHub!

Trying to implement a custom SlateJS element following the custom-website-series.

2 months ago

I have everything set up the same, but I keep getting this error on the front-end. What is set up differently in the custom-website series that allows one to use useSlate in their elements/leaves?

It is also used in the link element in the current build of payload

  • jmikrut
    Payload Team
    last month

    you should be able to


    for sure

    do you have a local copy of Slate installed?

    it must be on the same version otherwise your


    hook could be using a different copy of context vs. the internal one that Payload uses. You also might try and add a webpack alias to enforce that Webpack always uses the same copy of Slate, which would alleviate this even if you did have multiple copies installed

  • blupandaman
    last month

    Ok I will double check those and get back to you on that! Thanks for the tip

  • reepicheep05
    last month

    hey @blupandaman , wanted to ask what your solution was to this as I am getting the same error.

    I am starting a project and using the PayloadCMS website repo as a starting point. The


    hook is called in the richText field in the video Button component and I am getting this error whenever the Rich Text Editor is rendered in the admin.

    Edit: I believe this was caused by a


    version mismatch as pointed out by @jmikrut . I was able to resolve by uninstalling




    . Thanks for the help!

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More