Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: showing visual editor #1117

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

cadamsdev
Copy link
Contributor

@cadamsdev cadamsdev commented Dec 21, 2024

πŸ”— Linked issue

resolves #1114

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This fixes a regression with the recent @nuxtjs/sanity@1.13.2 changes which causes an error when we try to use the visual editor and we use useSanityQuery without passing in the second argument (the query params object)

e.g

const { data: movies, encodeDataAttribute } = await useSanityQuery<QueryResult[]>(query)
500
"undefined" is not valid JSON
at JSON.parse ()
at setupFetcher (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@nuxtjs/sanity/dist/runtime/composables/visual-editing.js?v=ccddcf37:125:14)
at useSanityQuery (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@nuxtjs/sanity/dist/runtime/composables/visual-editing.js?v=ccddcf37:155:7)
at http://localhost:3000/_nuxt/app.js:18:98
at withAsyncContext (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js?v=ccddcf37:3396:19)
at setup (http://localhost:3000/_nuxt/app.js:18:74)
at callWithErrorHandling (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js?v=ccddcf37:197:19)
at setupStatefulComponent (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js?v=ccddcf37:7923:25)
at setupComponent (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js?v=ccddcf37:7884:36)
at mountComponent (http://localhost:3000/_nuxt/@fs/home/crazypanda/workspaces/nuxt-sanity-visual-editor-example/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js?v=ccddcf37:5240:7)

This prevents the visual editor from showing up.

@cadamsdev cadamsdev requested a review from danielroe as a code owner December 21, 2024 03:07
Copy link

netlify bot commented Dec 21, 2024

βœ… Deploy Preview for nuxt-sanity-module canceled.

Name Link
πŸ”¨ Latest commit 88692da
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-sanity-module/deploys/676630ee1f084d0008bffabc

Copy link
Collaborator

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@danielroe danielroe merged commit 5dc6524 into nuxt-modules:main Dec 21, 2024
6 checks passed
@cadamsdev cadamsdev deleted the fix/showing-visual-editor branch December 21, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get Sanity visual editor working with nuxt site locally
2 participants