-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Warning from NuxtLayout: Your project has layouts but the <NuxtLayout />
component has not been used.
#24912
Comments
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
I tried reproducing a demo using the latest version, but I couldn't replicate the bug. The problem might be related to the upgrading process rather than the current version. |
I have got the same issued when I updated one of my projects as well, I'm still trying to track down what the guilty culprit is, I will let you know if I get it figured out. |
Same here. Removing my .nuxt folder fixes it for me. (did'nt even need restart the app). Looks to me like it somehow loses track of app.vue |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm also facing the same issue as well i don't know why this issue is closed even though it's a nuxt 3 bug.
|
Same issue!!! |
@waleedtariq109 Please provide a reproduction then - happy to reopen the issue if you can provide one 👍🏻 |
This comment was marked as duplicate.
This comment was marked as duplicate.
@armenr Without a reproduction we can't do much here. Also, no full-blown project is needed (and actually discouraged as the reproduction should be minimal) 😋 |
I found a consistent reproduction! Here's the link https://github.com/chris-visser/layout-not-used Reproduction NuxtLayout component not used
It looks like it looses references / symlinks on laptop restart? One other note. Not sure if related, because it might be my IDE When adding a new component my PyCharm IDE doesn't recognize that new component's auto import |
If it helps, this only happens for me if I use Vuetify with a project and more specifically the "vuetify-nuxt-module". I cannot get it to happen with a generic out-of-the-box Nuxt project or one with, for example, Nuxt UI added to it. |
After some testing. It is an issue of Nuxt 3.9, it is not present Nuxt 3.8 Steps to reproduce:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
Not sure if reproduction is still needed, but here is one without 3rd party libs:
|
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Please stop posting "+1" or "me too". Instead, simply 👍🏻 the issue! If you have more info to add (e.g. another case/reproduction/...), feel free to do so though. Also important to note: This does not break any behavior. It is just a warning and won't impact your app except logging this in dev. |
worked for me: 1) delete .nuxt 2) add |
This issue seems to happen when you use navigateTo() in the global middleware |
@mabutalid-kroma me too I didn't get any warning until adding middleware with
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<template>
<div>
<slot />
</div>
</template> Trying middleware from Docs export default defineNuxtRouteMiddleware((to, from) => {
if (to.params.id === '1') {
return abortNavigation()
}
// In a real app you would probably not redirect every route to `/`
// however it is important to check `to.path` before redirecting or you
// might get an infinite redirect loop
if (to.path !== '/') {
return navigateTo('/')
}
}) then some pages <template>
<div>
<h1>Tes Page</h1>
</div>
</template>
<script setup lang="ts">
definePageMeta({
middleware: ["test"]
})
</script> My environment "nuxt": "^3.9.3", with
and yes, for my case, this is just warning didn't break application |
Any update? [nuxt] Your project has layouts but the |
Your issue may be resolved in 3.10.1. If not, please open a new issue with reproduction. |
Upgraded to 3.10.1, same issue. I could only fix it by downgrading to 3.8. |
Same issue here, I am using Nuxt 3.10.0. The problem only appears while using navigateTo inside a middleware. |
No longer having the issue on 3.10.2 |
Still encountering this issue as of 3.10.2 "dependencies": {
"@heroicons/vue": "^2.1.1",
"@nuxtjs/supabase": "^1.1.6",
"@nuxtjs/tailwindcss": "^6.11.4",
"@nuxtjs/turnstile": "^0.6.3",
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@pinia/nuxt": "^0.5.1",
"@tailwindcss/forms": "^0.5.7",
"@vueuse/nuxt": "^10.7.2",
"nuxt": "^3.10.2",
"nuxt-headlessui": "^1.1.5",
"vue": "^3.4.19",
"vue-router": "^4.2.5"
}, |
I'm also having the same issue (using the latest nuxt version: 3.10.2) here is my App's structure: here is my browser's console output: edit: I found the issue that triggers the warning. If I remove the flag, the NuxtPage is available right from the start and the warning disappears. |
For me the problem was that i forgot |
IMO, this check should run when the page has finished loading, so that v-if conditions can be evaluated first, before this check applies. |
The error was explained with more details in error.stack. Thanks to that, I found my error and was able corrected it. To get the error.stack: create at the same level that app.vue an error.vue.
|
I'm also getting this error in a Nuxt Ionic App. In this case I am not using
|
IonRouter does not use NuxtPage. This should be worked around in https://github.com/nuxt-modules/ionic. |
Environment
package.json
{ "nuxt": "^3.9.0", "typescript": "^5.2.2", "vue": "3.4.0-rc.3", "vue-router": "latest" }
Reproduction
I upgraded Nuxt from
3.8.2
to3.9.0
Describe the bug
I upgraded to the latest Nuxt version (3.9.0), Vue (3.4.0-rc.3), and the latest vue-router, but I'm getting a warning.
There's no error, but rather annoying.
Additional context
Only my
app.vue
file contains<NuxtLayout>
component. Here is myapp.vue
file:Logs
The text was updated successfully, but these errors were encountered: