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

Component inside <ClientOnly> is not rendered #980

Open
huynhtehoa opened this issue Mar 31, 2024 · 0 comments
Open

Component inside <ClientOnly> is not rendered #980

huynhtehoa opened this issue Mar 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@huynhtehoa
Copy link

huynhtehoa commented Mar 31, 2024

Hi, first of all, thank you for the great module.

I'm new to both Nuxt and Sanity so I'm unsure if this is a bug or I am doing something wrong as I cannot find any documentation as well as related reports for this issue.

Problem

I am facing a problem where component inside <ClientOnly> tag (or cmp.client.vue) is not rendered at all when using Sanity query.

image

The error message from the console is:
image

If I remove any of the Sanity composables (useSanityQuery or useLazySanityQuery), the client component will be rendered normally

Workaround

A workaround (or intended feature) I found is to enable minimal: true for Sanity inside nuxt.config.ts

Reproduction

You can clone these apps to test. But they are entirely fresh so any inited apps will do.

  1. Nuxt: https://github.com/huynhtehoa/sanity-nuxt-test
  2. Sanity: https://github.com/huynhtehoa/test-sanity

Note:
I tried to reproduce on StackBlitz here but the issue does not occur. The only difference is I'm using pnpm for local development whereas StackBlitz uses npm (and its other env)

System

  • OS: WSL 2 Ubuntu 20.04
  • Node: 18.20.0
  • pnpm: 8.15.5
  • Nuxt: 3.11.1
  • @nuxtjs/sanity: 1.10.1
@huynhtehoa huynhtehoa added the question Further information is requested label Mar 31, 2024
@maige-app maige-app bot added bug Something isn't working needs-repro labels Mar 31, 2024
@danielroe danielroe removed needs-repro question Further information is requested labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants