CyanicPenguin
CyanicPenguin
NNuxt
Created by CyanicPenguin on 10/18/2024 in #❓・help
Content does not load in production
Hello. I have started building a basic blog using @nuxt/content with markdown. Content files are inside content/blog folder. The blog index Vue file is inside pages/blog/index.vue. Here's the way I query the content:
const { data: articles } = await useAsyncData(
'articles',
() => queryContent('blog')
.sort({
date: -1
})
.find()
)
const { data: articles } = await useAsyncData(
'articles',
() => queryContent('blog')
.sort({
date: -1
})
.find()
)
On the server, articles is null . It never retrieves the articles correctly. Tried different sorts of tweaking and different ways to do it, but I didn't get to a solution. One test I did, was to go in the build files, and just change the useAsyncData id to something else, that seemed to have worked, but this is not a correct fix, just a test. Is there anything I'm missing?
3 replies