I am using the asyncData method to retrieve the content of a json5 file and I get an empty array.
My file is located at content/myfile.json5
The content is :
[
{
id: 1
},
{
id: 21
}
]
And my method is :
async asyncData({ $content}) {
const test = await $content('myfile').fetch()
return {
test
}
}
I am also not able to fetch an array if I use a regular .json file nested in a directory, like /content/places/places.json. The result is an object filled with the first item of my array. It looks like it only works when it's located at the root content folder. I can't find any explanation in the docs.