You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'm a little puzzled about something. Support was added for using JSON arrays for content a while back. As far as I can tell, I'm doing everything right.. but no data is getting loaded in my project. According to the newly added docs for this feature.. there's really nothing special that needs to be done to get this to work, it just has to be a top-level array.
What am I missing?
@nuxt/content 1.15.1 nuxt 2.15.7 (or .8? - I'm a little confused about this, details are at the bottom of this post)
When I run the project, the links array is always empty:
I've tried simplifying the json down to the absolute bare minimum but it doesn't help
[
{ "title": "foo" },
{ "title": "bar" }
]
Any ideas? Thank you 😊
Nuxt version info 👇
I'm not sure if this is at all related, but I'm a little confused about my nuxt version. npm list shows nuxt 2.15.8, my package.json has 2.15.8 set, but when I run nuxt dev it shows I'm running 2.15.7.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
SOLVED: I needed to add a slug. I tried that yesterday and it wasn't working, but now it is.
Works:
Doesn't work:
ORIGINAL QUESTION:
Hi. I'm a little puzzled about something. Support was added for using JSON arrays for content a while back. As far as I can tell, I'm doing everything right.. but no data is getting loaded in my project. According to the newly added docs for this feature.. there's really nothing special that needs to be done to get this to work, it just has to be a top-level array.
What am I missing?
@nuxt/content 1.15.1
nuxt 2.15.7
(or .8? - I'm a little confused about this, details are at the bottom of this post)content/links.json:
pages/links.vue:
When I run the project, the links array is always empty:
I've tried simplifying the json down to the absolute bare minimum but it doesn't help
Any ideas? Thank you 😊
Nuxt version info 👇
I'm not sure if this is at all related, but I'm a little confused about my nuxt version.
npm list
shows nuxt 2.15.8, my package.json has 2.15.8 set, but when I runnuxt dev
it shows I'm running 2.15.7.Beta Was this translation helpful? Give feedback.
All reactions