sanity-io / visual-editing

https://visual-editing-studio.sanity.build
MIT License
37 stars 20 forks source link

<SanityLive /> causes the page to crash on PageSpeed insights #2099

Closed dagstuan closed 2 weeks ago

dagstuan commented 4 weeks ago

Describe the bug

When using the new <SanityLive /> component from defineLive(), the website crashes when I run it through PageSpeed Insights. According to sentry.io the crash is inside the <SanityLive />-component when it tries to verify connection. See screenshots:

image image

To Reproduce

Steps to reproduce the behavior:

Deploy a website that renders <SanityLive />. Run it through pagespeed insights.

Expected behavior

No crash

Which versions of Sanity are you using?

@sanity/icons 3.4.0 (up to date) @sanity/image-url 1.0.2 (up to date) @sanity/preview-url-secret 2.0.0 (up to date) @sanity/ui 2.8.13 (up to date) @sanity/uuid 3.0.2 (up to date) @sanity/vision 3.62.3 (up to date) sanity 3.62.3 (up to date)

stipsan commented 3 weeks ago

Great catch! We'll change the behaviour so that it doesn't throw during render by default!

stipsan commented 2 weeks ago

@dagstuan can you try https://github.com/sanity-io/next-sanity/releases/tag/next-sanity-v9.8.10 and tell me if it works out for you?

dagstuan commented 2 weeks ago

@stipsan Seems to work fine now! Thanks for the fix 🥳