Replies: 17 comments 12 replies
-
Hard to tell spontaneously. Feel free to share some code for more help |
Beta Was this translation helpful? Give feedback.
-
Most likely you have created the pages directory, but you still have the default app.vue file, which does not use the NuxtPage component. <template>
<div>
<NuxtWelcome />
</div>
</template> to: <template>
<div>
<NuxtPage />
</div>
</template> If you are not using the app.vue, then most likely it takes the standard one from the nuxt module (but this is not accurate) |
Beta Was this translation helpful? Give feedback.
-
Hello, I have the same problem since Nuxt 3.10 :) |
Beta Was this translation helpful? Give feedback.
-
This is fixed in 3.10.2 :) |
Beta Was this translation helpful? Give feedback.
-
i had the same issue but adding in my /layouts/default.vue fixed it. |
Beta Was this translation helpful? Give feedback.
-
For anyone else, the correct answer is using the following inside your layouts
|
Beta Was this translation helpful? Give feedback.
-
and |
Beta Was this translation helpful? Give feedback.
-
I am on version |
Beta Was this translation helpful? Give feedback.
-
This warning can also appear when you're slot is conditional. <SplashScreen v-if="isLoading" />
<slot v-else /> |
Beta Was this translation helpful? Give feedback.
-
I get this warning too, because I am conditionally rendering <template>
<NuxtLoadingIndicator />
<div v-if="auth">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
<UContainer v-else>
<LoginCard class="mt-24 max-w-md mx-auto" />
</UContainer>
<UNotifications />
</template>
<script setup lang="ts">
const auth = useAuthState();
</script>
<style scoped></style> This was the easiest architecture for me without having to manage layouts for auth and non authed states, or managing redirects. But as Alex mentioned, since it works as expected, I am choosing to ignore the warning for now. |
Beta Was this translation helpful? Give feedback.
-
I add this issue and my problem was not adding a |
Beta Was this translation helpful? Give feedback.
-
Yeah, for me, I just fixed it by updating |
Beta Was this translation helpful? Give feedback.
-
I've had the same issue, this is probably because one of your layouts has a NuxtPage which is conditionally rendered
|
Beta Was this translation helpful? Give feedback.
-
check app.vue and layouts/default.vue |
Beta Was this translation helpful? Give feedback.
-
To solve the conditional rendering issue, I used. /layouts/default
|
Beta Was this translation helpful? Give feedback.
-
OK, just sharing my thoughts! "This error occurs because Nuxt is still looking for pages in the
And I've put all the contents of the |
Beta Was this translation helpful? Give feedback.
-
I wanted to share my experience with this warning. In my layout, I centralize authentication logic: while the session is loading, I show a loader and don't render the slot; once loaded, I either redirect to login or show the slot if authenticated. Example: <template>
<main>
<div v-if="session.isPending || session.isRefetching">Loading...</div>
<slot v-else="session.data" />
</main>
</template>
<script setup>
const session = authClient.useSession()
const { path } = useRoute()
watch(session, s => {
if (s.isPending || s.isRefetching) return
if (!s.data && path !== '/login') navigateTo('/login', { replace: true })
}, { immediate: true })
</script> Using I think layouts that gate rendering based on async auth are a valid use case, but current Nuxt behavior makes this tricky. I could just ignore the warning for this use case but that isn't clean. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi :)
After upgrading from Nuxt 3.7 to 3.10 I started getting a bunch of these warns:
The thing is, I'm not using
<RouterView />
. I'm using file-based routing, not even having anapp.vue
.What could I be missing?
Beta Was this translation helpful? Give feedback.
All reactions