NuxtN
Nuxtβ€’12mo agoβ€’
13 replies
Thorge

Static builds with nuxt content result in empty pages

My [slug].vue :

<script setup>
const path = useRoute().path
const { data: page } = await useAsyncData(`${path}`, () => {
  return queryCollection('pages').path(path).first()
})
</script>

<template>
  <ContentRenderer v-if="page" :value="page" />
</template>


When running in dev mode, everything works fine and my page content is shown.

When generating with npx nuxi generate my build has empty pages. I tried both with ssr: false/true.

My nitro config:

nitro: {
  static: true,
  prerender: {
    crawlLinks: true,
    failOnError: false,
  },
}


Would anyone be able to help? 😊
Was this page helpful?