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
you should be able to
useSlate
for sure
do you have a local copy of Slate installed?
it must be on the same version otherwise your
useSlate
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
Ok I will double check those and get back to you on that! Thanks for the tip
hey
@1028003433090924695, 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
useSlate
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
slate
version mismatch as pointed out by
@364124941832159242. I was able to resolve by uninstalling
slate
and
slate-react
. Thanks for the help!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.