Skip to content

Pre-rendering Errors #3469

@kieranmansfield

Description

@kieranmansfield

Environment

Version

v3.6.3

Reproduction

./index.vue

<script setup>

const { data: posts } = await useAsyncData("work", () =>
  queryCollection("work").first()
)
</script>


<template>

<UPageSection>

<UPageHero class="font-display">

<template #title>
<div class="text-left">
<h1>Latest</h1>
<h1>Work</h1>
</div>
</template>

</UPageHero>

  
<UBlogPost v-bind="posts" :to="posts.meta.link" variant="naked" orientation="horizontal" 
:ui="{
title: 'font-bold uppercase font-logo text-6xl tracking-wide',
}" />

</UPageSection>
</template>

/work/index.vue

<script setup lang="ts">
const { data: posts } = await useAsyncData("work", () =>
  queryCollection("work").all()
)
</script>

<template>
  <UPage>
    <UPageHero
      title="Work"
      :ui="{
        title: 'font-bold uppercase font-logo tracking-wide sm:text-xxxl',
      }" />

    <UPageBody>
      <UContainer>


        <UBlogPosts orientation="vertical">
          <UBlogPost
            v-for="(post, index) in posts"
            :key="index"
            v-bind="post"
            :to="post.path"
            variant="naked"
            orientation="horizontal"
            :ui="{
              title: 'font-bold uppercase font-logo text-6xl tracking-wide',
            }" />
        </UBlogPosts>
      </UContainer>
    </UPageBody>
  </UPage>
</template>

Description

I'm having some weird issues with Nuxt Content, it builds and deploys on Netlify but does not on my local machine.

All of this started kicking off after I modified some queries I can't see where the issue is. I've tried some of my npm commands to try and rectify the issue for example these commands in my package.js:

    "clean": "rm -rf ./node_modules package-lock.json .nuxt .output .data && npm i",
    "cleancache": "npm cache clean --force && npm cache verify",

I'm really at a loss as to what the problem is, I imagine it's something small I've missed.

Additional context

No response

Logs

nitro 7:35:14 PM
Errors prerendering:
  ├─ /work (483ms)                                                                                                                                                         nitro 7:35:14 PM
  │ ├── [500] Server Error
  │ └── Linked from /
  │ └── Linked from /about
  │ └── Linked from /projects
  │ └── Linked from /contact
  │ └── Linked from /services
  │ └── Linked from /blog
  │ └── Linked from /test
  │ └── Linked from /blog/theme-color
                                                                                                                                                                           nitro 7:35:14 PM

 ERROR  Exiting due to prerender errors.                                                                                                                                         7:35:14 PM

    at prerender (node_modules/nitropack/dist/core/index.mjs:2199:11)
    at async node_modules/nuxt/dist/index.mjs:4456:5
    at async build (node_modules/nuxt/dist/index.mjs:7105:3)
    at async Object.run (node_modules/@nuxt/cli/dist/chunks/build.mjs:76:5)
    at async Object.run (node_modules/@nuxt/cli/dist/chunks/generate.mjs:38:5)
    at async runCommand (node_modules/citty/dist/index.mjs:316:16)
    at async runCommand (node_modules/citty/dist/index.mjs:307:11)
    at async runMain (node_modules/citty/dist/index.mjs:445:7) 



 ERROR  Exiting due to prerender errors.                                                                                                                                         7:35:14 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions