Open dagstuan opened 2 weeks ago
Amazingly, this seems to be related to using react-components as media
previews for documents. If I remove all references to react-components from my schema type previews, everything works correctly. But a setup such as the one below yields an error:
But the following setup works fine:
I also had the same problem. Though I had the key icon
in the prepare() function for a schema preview (oops). But same scenario as @dagstuan with having JSX components inside of the preview settings for a schema definition.
Thanks for reporting! We'll look into this next week 🙌
Following. Also noticed that the issue started when moving from 3.61.0 to 3.62.0.
Describe the bug
I'm using Sanity with Next.js 14. I have set up visual editing using the documentation, after upgrading the packages to the newest versions, the Presentation tool crashes with the following error
After the crash I receive a lot of warnings in the console like:
I have traced the error back to [@sanity/visual-editing@2.2.0] which introduces comlink for messaging. If I downgrade that package to 2.1.9 and then downgrade all the other packages to match, everything starts working again.
To Reproduce
It's hard to say how to reproduce. I have another solution that works fine, but the one I'm working on now crashes. So it might be related to my code/dataset somehow. But I haven't changed any of my own code apart from upgrading packages.
Expected behavior
No crash.
Screenshots
Which versions of Sanity are you using?
@sanity/code-input 4.1.4 (up to date) @sanity/image-url 1.0.2 (up to date) @sanity/orderable-document-list 1.2.2 (up to date) @sanity/preview-url-secret 2.0.0 (up to date) @sanity/react-loader 1.10.14 (up to date) @sanity/ui 2.8.10 (up to date) @sanity/vision 3.62.2 (up to date) sanity 3.62.2 (up to date)
What operating system are you using?
Mac OS Sonoma 14.6.1