sanity-io / sanity-plugin-iframe-pane

Display any URL in a View Pane, along with helpful buttons to copy the URL, display a mobile size, reload the iframe or open in a new tab
MIT License
47 stars 13 forks source link

Studio breaks with CORS error #106

Open th-km opened 9 months ago

th-km commented 9 months ago

Describe the bug

In production, when I open the preview pane, I get a CORS error related to the comment API.

This issue occurs only when the preview pane is open, preventing me from editing fields and causing the studio to crash.

Access to XMLHttpRequest at 'https://api.sanity.io/v2023-12-11/journey/comments?tag=sanity.studio' from origin 'xxx' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

It works fine in local development and when previewing on another tab.

Which versions of Sanity are you using?

sanity 3.31.0 and sanity-plugin-iframe-pane 3.1.3

What operating system are you using?

macOS 12.6

Which versions of Node.js / npm are you running?

node v20.11.1

Additional context

I'm not sure if this is related to preview-kit, sanity-plugin-iframe-pane or Sanity itself, since it's related to the comment API.

ndimatteo commented 9 months ago

Also getting this with the Presentation Tool and live preview after following your guide here: https://www.sanity.io/guides/nextjs-live-preview

Works locally. Does not work in production when deployed to sanity.studio.

Completely breaks the experience as updates are not streamed to the preview as you update, defeating the purpose of the entire plugin.

Henkisch commented 8 months ago

+1

joshoconnor commented 8 months ago

+1

amlcodes commented 6 months ago

+1