NuxtN
Nuxt6mo ago
5 replies
peoray

Content: Articles not displaying on page load in Nuxt 4

There appears to be an issue on the deployed website, where the content articles do not display on page load until I navigate and return to the page, and then the content becomes visible. My site is deployed on Coolify, hosted on Hetzner. This is the URL: https://okikelabs.com/

This is the code to query for articles:

// index.vue

const { data: posts } = await useAsyncData('home', () => {
  return queryCollection('blog')
    .where('draft', '=', 0)
    .select('slug', 'title', 'description', 'date', 'image', 'category')
    .order('date', 'DESC')
    .limit(2)
    .all()
})


// blog/index.vue

const { data: posts } = await useAsyncData('blog', () => {
  return queryCollection('blog')
    .where('draft', '=', 0)
    .select('slug', 'title', 'description', 'date', 'image', 'category')
    .order('date', 'DESC')
    .all()
})
Was this page helpful?