Ive been trying to fix this issue for at least a day now. From what i can tell, my content.config.ts is right and everythings in the right folders too, but even if i try to query the entire collection, absolutely nothing gets returned and all i get is null.
content.config.ts
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
blogs: defineCollection({
type: 'data',
source: 'blogs/**/*.md',
schema: z.object({
date: z.string(),
title: z.string(),
description: z.string(),
})
}),
projects: defineCollection({
type: 'data',
source: 'projects/**/*.md',
schema: z.object({
date: z.string(),
title: z.string(),
description: z.string(),
})
})
}
})
Example blog at /content/blogs/test.md
---
title: "Building a Nuxt Blog"
description: "A simple guide on how to build a blog with Nuxt Content."
date: 2025-04-27
---
# Building a Nuxt Blog
This is the full article content for "Building a Nuxt Blog".
test page to show absolutely everything
<template>
<div class="p-8">
<h1>All Content</h1>
<pre>{{ all }}</pre>
</div>
</template>
<script setup>
const { data: all } = await useAsyncData('all', () => queryContent().find())
</script>
afaik, it should show all the content, but in return, i get an empty <pre> element