-
-
Notifications
You must be signed in to change notification settings - Fork 716
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: npm@11.5.1
- Builder: -
- User Config: compatibilityDate, devtools, modules, css, content
- Runtime Modules: @nuxt/content@3.6.3, @nuxt/eslint@1.9.0, @nuxt/image@1.11.0, @nuxt/ui@3.3.2, @vueuse/nuxt@13.7.0
- 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
peter-chipello, sot1986, Jasonzyt and tazim404
Metadata
Metadata
Assignees
Labels
No labels