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

Layout warning #2

Closed
dan-bowen opened this issue Sep 5, 2022 · 3 comments
Closed

Layout warning #2

dan-bowen opened this issue Sep 5, 2022 · 3 comments

Comments

@dan-bowen
Copy link
Owner

npm run dev is logging the following error.

 WARN  Using <NuxtLayout> inside app.vue will cause unwanted layout shifting in your application.Consider removing <NuxtLayout> from app.vue and using it in your pages.

app.vue matches the Nuxt docs for the app file so I'm not sure what to make of it.

@Demivan
Copy link

Demivan commented Oct 9, 2022

Hi. Found this issue as a first link in Google when googling this Nuxt warning. :)

This error comes from @nuxt/content when injectPage is enabled. Because you have own [...slug].vue implementation, you just need to disable injectPage option.

By the way you can use: const { page: blogPost } = useContent() instead of queryContent when you have document-driven mode enabled.

@dan-bowen
Copy link
Owner Author

@Demivan Thank you so much for kindly helping me! I am using this repo to learn Vue and sometimes it is hard to find the answers on your own. Hopefully documenting and solving issues along the way will help others too.

Thank you again. 🙏

@dan-bowen
Copy link
Owner Author

dan-bowen commented Dec 26, 2022

This solved in PR #9

It may be useful to track the following upstream issue which may change the way this was resolved.

nuxt/nuxt#15240

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

No branches or pull requests

2 participants