-
-
Notifications
You must be signed in to change notification settings - Fork 704
Open
Description
Environment
- Operating System: Darwin
- Node Version: v22.17.0
- Nuxt Version: 3.17.6
- CLI Version: 3.25.1
- Nitro Version: 2.11.13
- Package Manager: [email protected]
- Builder: -
- User Config: modules, experimental, linkChecker, googleTranslate, site, colorMode, hub, content, llms, eslint, image, icon, booster, nitro, css, compatibilityDate, devtools, future, runtimeConfig
- Runtime Modules: @nuxt/[email protected], @nuxtjs/[email protected], @nuxt/[email protected], @nuxthub/[email protected], @nuxt/[email protected], @nuxt/[email protected], [email protected], @nuxt/[email protected], [email protected], [email protected], motion-v/[email protected], [email protected]
- Build Modules: -
Version
v3
Reproduction
https://github.com/sdnteja2/sdnteja2.sch.id/blob/master/content.config.ts
Description
When using Nuxt Studio with the collection configuration in content.config.ts, the following error appears:
We're not able to parse the code syntax (json or yaml). Please check the data structure.
The file structure follows the official documentation and is valid TypeScript. Here is an example of the structure used:
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: {
include: '*.md',
exclude: ['berita/**', 'guru/**'],
},
schema: z.object({
title: z.string(),
description: z.string(),
seo: z.intersection(
z.object({
title: z.string().optional(),
description: z.string().optional(),
meta: z.array(z.record(z.string(), z.any())).optional(),
link: z.array(z.record(z.string(), z.any())).optional(),
}),
z.record(z.string(), z.any()),
).optional().default({}).editor({ hidden: true }),
navigation: z.object({
icon: z.string().editor({ input: 'icon' }),
}),
}),
}),
// ... other collections such as berita, guru, artikel, etc.
},
})
Additional context
Steps to Reproduce
- Run Nuxt Studio on a project with the above configuration.
- Open the collection page in Nuxt Studio.
- The error appears: We're not able to parse the code syntax (json or yaml). Please check the data structure.
Logs
Metadata
Metadata
Assignees
Labels
No labels