sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Nuxt Devtools and Visual Editing

Open g0shed opened this issue 11 months ago • 5 comments

Version

module: 1.9.0 nuxt: 3.10.3

What is expected?

To use the visual Editor feature

What is actually happening?

I get two errors:

client.mjs:41 Nuxt DevTools: Failed to check parent window
client.mjs:41 DOMException: Failed to read a named property '__NUXT_DEVTOOLS_DISABLE__' from 'Window': Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.

Steps to reproduce

Have both devtools and Sanity plugins enabled with Visual Editing set

Checklist

  • [x] I have tested with the latest Nuxt version and the issue still occurs
  • [x] I have tested with the latest module version and the issue still occurs
  • [x] I have searched the issue tracker and this issue hasn't been reported yet

What is actually happening?

An error occurs when using with DevTools

g0shed avatar Mar 10 '24 22:03 g0shed

Presumably you're able to use Visual Editing, but the devtools doesn't work within the Presentation iframe?

danielroe avatar Mar 10 '24 23:03 danielroe

Correct @danielroe

g0shed avatar Mar 11 '24 01:03 g0shed

@danielroe

another issue maybe related:

error caught during app initialization ReferenceError: useState is not defined
    at useSanityVisualEditingState (visual-editing.mjs?v=41fb01d1:51:19)

g0shed avatar Mar 13 '24 15:03 g0shed

another issue maybe related:

error caught during app initialization ReferenceError: useState is not defined
    at useSanityVisualEditingState (visual-editing.mjs?v=41fb01d1:51:19)

This is unrelated, but a fix for it went in v1.10.1 which should be published shortly.

rdunk avatar Mar 13 '24 15:03 rdunk

another issue maybe related:

error caught during app initialization ReferenceError: useState is not defined
    at useSanityVisualEditingState (visual-editing.mjs?v=41fb01d1:51:19)

This is unrelated, but a fix for it went in v1.10.1 which should be published shortly.

Gotcha, but the initial issue still remains

g0shed avatar Mar 13 '24 15:03 g0shed

This is an upstream issue (or possibly limitation) in nuxt/devtools. It occurs whenever devtools is loaded within an iframe, such as within Stackblitz.

It would be worth raising upstream: https://github.com/nuxt/devtools/issues.

danielroe avatar Mar 21 '24 12:03 danielroe