-
-
Notifications
You must be signed in to change notification settings - Fork 676
When navigating to nuxt content page I get "You should use slots with <ContentRenderer>" #2128
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I've narrowed the issue down to: const { data } = await useAsyncData( Returning an array with absolutely all the content rather than the singular bit of content that was requests. This is also replicated on other pages where it's filtering by category - in some instances it doesn't - instead displaying all content. Almost like when rendered on the client it's just ignoring everything apart from "queryContent()". This appears to only occur when the page is loaded by the client. When I navigate directly to the page in question it all works as expected (as in screenshots above). |
I have the same issue... I'm willing to support nuxt to get this fixed @atinux my business SEO depend on this |
It might happen when there is a new redeploy and you are navigating on client-side, can you confirm? |
EDIT: fixed by running Having this same issue, with both https://deploy-preview-136--maizzle-docs.netlify.app/ Of course, it all works fine when developing locally. ReproductionSee this PR: maizzle/maizzle.com#136 And this particular commit: maizzle/maizzle.com@ ContentRendererCode used (copied from docs page): <ContentQuery path="code/environment" find="one" v-slot="{ data }">
<ContentRenderer :value="data" />
</ContentQuery> But this doesn't work either: <ContentQuery path="code/environment" find="one">
<template #default="{ data }">
<ContentRenderer :value="data" />
</template>
</ContentQuery>
Result: ![]() ContentListCode used (also copied from docs page): <ContentList :query="guides" v-slot="{ list }">
<div
v-for="guide in list"
:key="guide.title"
>
...
</div>
</ContentList> But this doesn't work either: <ContentList :query="guides">
<template #default="{ list }">
<div
v-for="guide in list"
:key="guide.title"
>
...
</div>
</template>
</ContentList> Result: ![]() System info
|
@atinux it's 100% of the time for me :/ |
with the last change i made, (disable cloudflare optimization as suggessted in the doc and discord) i have now infinite loading here: https://capgo.app/blog/ |
On my side i managed to fix partially the issue. by disabling the netlify-edge preset. How to reproduce: open console and empty cache CleanShot.2023-08-06.at.17.05.01.mp4It seems if I disable PWA config (who never change since a year) |
Im also running into the same issue. Switched to Decap CMS, so my files are in markdown and i cant seem to find a way to render the markdown bit properly. Rendering the string is not an issue offcourse, but when using Examples:
package.json:
|
Does it happen when you navigate on client-side and a new generate has been deployed in-between? |
@atinux for me that was always happening, no matter the env even in local dev |
I have the same issue, but only if the page was directly requested from the server. |
also have the same issue. works locally but when building it just shows: { Edit: In my case it seems the content is actually missing from the build for some reason, because adding the #not-found template shows the not-found message. So for me the issue really is that the entire content directory isn't being included in the build.. idk why |
Also having the same issue deploying to netlify and with a |
I had the same error message. My original code was:
I added curly brackets to the 'doc' inside the 'template' tag like this:
That solved it. I hope it helps some of you. |
Thanks. I'd like to be able to use |
Same for me, but has the error appears locally both for In my case, fix was to change My original code was: const { page } = useContent();
const { data } = await useFetch(`/api/meta?path=${page.value._path}`); Updated code: const { page } = useContent();
const data = await $fetch(`/api/meta?path=${page.value._path}`); ...and yep, It looks, like it's a Nuxt-Content bug. |
Yup! It helped! Thanks! |
But in SSG mode |
Still happening. What is really scary is that in dev mode everything works super dandy. Things fall apart after deployment. |
Same issue. Everything working in dev mode, but after I was using both Removing the Things that I have tried without results:
|
Hi, I have exactly the same issue in prod (dev works perfectly) :S |
+1 Same issue |
I'm seeing the same issue with <ContentQuery path="/open-source/_intro" find="one" v-slot="{ data }">
<ContentRenderer :value="data">
<ContentRendererMarkdown :value="data" />
</ContentRenderer>
</ContentQuery> or <ContentQuery path="/open-source/_intro" find="one" v-slot="{ data }">
<ContentRenderer :value="data"></ContentRenderer>
</ContentQuery> in prod only after All queries return a 404, e.g.
This was working before. This update seems to break: posva/esm.dev@a3732d6. Using nuxt 3.12.2 works (generates all the needed files in |
@posva If it's what I think it should be resolved in next Nuxt patch and you can workaround by adding |
Indeed! That worked! |
Hi, I can't get it to work although I updated the nuxt version (3.12.4) and added the "/" in nitro.prerender.routes. |
@GuillaumeDgr Can you provide a reproduction? 🙏 |
After updating nuxt and nuxt-content, an error appeared only after rendering Nagrywanie.2024-09-26.213022.mp4Component in index page. <ContentQuery path="/solutions">
<template #default="{ data }">
<UiCard v-for="article in data" :key="article._path">
<template #link>
<NuxtLink
class="absolute top-0 bottom-0 left-0 right-0"
:to="article._path"
>
</NuxtLink>
</template>
<img
class="m-auto rounded-[0.6rem]"
:src="article.image"
:alt="article.title"
/>
<div class="w-full mt-2 font-semibold text-center">
{{ article.title }}
</div>
</UiCard>
</template>
<template #not-found>
<p>Nie znaleziono.</p>
</template>
</ContentQuery> |
BTW: https://danielhill.nuxt.space/ My ReproductionMy nuxt content website is opened in a browser. I add a mark down file and wait until the deployment process is complete. The website is still open in the browser. After the deployment is complete and I navigate to another page on the still opened website, the content of the article is no longer displayed with the note: "...use slots...". However, if I refresh the website using the browser button, the articles are displayed again and everything works normally. |
I fixed the "You should use slots with " issue according to the Nginx document for nuxt2, but it has caused page jumping and longer loading times. https://v2.nuxt.com/deployments/nginx/ The ones above are accessed via IP addresses, while the ones below are accessed via domain names (using Nginx). |
What do you mean by "all connections"? |
I think what you mean is to ensure that each update reduces the number of steps required to upload updates, Maybe you could try vercel? When you need to upload a new article, simply create a new article within your project and write it. Then, push it directly to GitHub, and Vercel will take care of the rest. |
You should buy a domain name that belongs to you. I recommend https://porkbun.com/ You can purchase the right to use a domain name for one year for just a little bit of money. |
I don't think that should be discussed in this issue. But it doesn't cost much to buy a domain name, it only costs a few dollars to buy a domain name (e.g..xyz,.app,.top), if you don't have the money or can't afford to spend it, my advice is to find a stable job with a stable income before you consider it. |
I deployed my website with vercel instead of the traditional method. It works great. The problem was solved for me. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
I have this similar issue.
When I load the page, rendered Markdown flashes briefly,, then is replaced with |
Hello, I had this bug and I found a solution: I removed Before
After
I think the bug occurs when you have a page with the same query inside
|
Environment
Darwin
v20.3.1
3.6.1
2.5.2
npm@9.7.2
vite
ssr
,fontsPath
,modules
,i18n
,router
,delayHydration
,routeRules
,hooks
,schemaOrg
,image
,content
,css
,googleFonts
,alias
,app
,plugins
,webpack
,sitemap
@nuxtjs/tailwindcss@6.8.0
,@nuxt/content@2.7.0
,@pinia/nuxt@0.4.11
,@nuxtjs/google-fonts@3.0.1
,@nuxtjs/i18n@8.0.0-beta.12
,@nuxt/image@1.0.0-rc.1
,nuxt-icon@0.1.8
,nuxt-schema-org@2.2.0
,@funken-studio/sitemap-nuxt-3@4.0.4
,@vueuse/motion/nuxt@2.0.0
,nuxt-delay-hydration@1.2.1
-
Reproduction
Fairly obvious, seems to have been reported by others in the last day. Nothing fancy going on on either of the pages with the bug in question. e.g. #1154 (comment)
It only appears to occur when deployed, when running npm run dev - all seems to work fine.
Describe the bug
When navigating to a page that uses Nuxt Content after deployment - if you go directly to the page via a url then it loads fine, but if you navigate to the page from like a blog root or something then it shows. Happening with the latest nuxt (3.6.1) and latest nuxt-content (2.7.0):
{
"message": "You should use slots with ",
...
}
Example Reproduction
Note: I've changed the links from NuxtLink > a to negate the issues for our users, so these are screenshots from before this hacky temporary fix was added.
When going directly to the post at https://www.sleepiest.com/blog/the-science-of-sleep/how-sleep-and-allergies-interact:
When navigating to the post from say https://www.sleepiest.com/blog and clicking on the first post is when the bug arises:
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: