-
-
Notifications
You must be signed in to change notification settings - Fork 726
Open
Description
Environment
- Operating System: Darwin
- Node Version: v24.6.0
- Nuxt Version: 4.0.3
- CLI Version: 3.27.0
- Nitro Version: 2.12.4
- Package Manager: [email protected]
- Builder: -
- User Config: compatibilityDate, devtools, modules, css, content
- Runtime Modules: @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @vueuse/[email protected]
- Build Modules: -
Version
3.6.3
Reproduction
A reproduction is in the discussion here: #3489
In my use case:
export default defineContentConfig({
collections: {
people: defineCollection({
type: "data",
source: "org/gdc.csv",
schema: z.object({
"Work Email": z.string().email(),
}),
}),
},
});const { data: tmpContent } = await useAsyncData("tmp-content", () => queryCollection("people").all());[
{
"id": "people/org/gdc.csv",
"Work Email": null,
"extension": "csv",
"meta": {
"path": "/org/gdc",
"body": [
...my csv data is here...
],
"title": "Gdc"
},
"stem": "org/gdc",
"__hash__": "t_hC0vKvEj6NWa3r_goNjnn4BEvwNnHt6Y8WvNiIUHI"
}
]Description
CSV data is not returned from queryCollection as it is for markdown. The result is an array of length 1 with a body attribute that has all the data.
The documentation mentions putting this in the config:
export default defineNuxtConfig({
content: {
build: {
csv: {
json: true,
},
},
},
});But it seems to have no effect.
The documentation also seems to have errors. The example schema has "name, email, avatar", then has two example csv files, with "id, name, email", and "name, role, avatar".
Additional context
Logs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels