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

<NuxtLayout /> component has not been used. Warning when using <ClientOnly> in app.vue #25196

Closed
manniL opened this issue Jan 14, 2024 · 6 comments · Fixed by #25714
Closed

Comments

@manniL
Copy link
Member

manniL commented Jan 14, 2024

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.9.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-issues-25196

<template>
  <ClientOnly>
    <NuxtLayout>
      <NuxtPage />
    </NuxtLayout>
  </ClientOnly>
</template>

Describe the bug

When using a <ClientOnly> component around the App.vue (only SSR the app shell), the NuxtLayout warning will appear even though the component is used.

Additional context

Related: #24912

Logs

No response

Copy link

stackblitz bot commented Jan 14, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@danielroe
Copy link
Member

Yes, this is a limitation in how we are checking whether the layout is used.

@zeezzh
Copy link

zeezzh commented Feb 1, 2024

I get the warning when using middleware call navigateTo().

@danielroe
Copy link
Member

@zeezzh Would you provide a reproduction? 🙏

@zeezzh
Copy link

zeezzh commented Feb 5, 2024

@danielroe See https://stackblitz.com/edit/github-bnh9zl.It happens when navigateTo called on server side.

@danielroe
Copy link
Member

We could bail on checking entirely if <ClientOnly> is used somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants