DEV Community

Discussion on: Build a blog with Nuxt, Contentful, Netlify and Tailwind

Collapse
 
vstothard profile image
Verity Stothard

Hey Thomas, I just revisited my code and you do need async/await on the asyncData method or the data caught in the stories variable below is a pending promise, causing the page to fail.

let blogPosts = await contentful.getEntries({ content_type: "blogPost" });

:)

Collapse
 
thomas_ph35 profile image
Thomas

yes ! I meant like this !
i'm pretty sure it would do the exact same thing :)

I use it that way with axios module.

Thread Thread
 
vstothard profile image
Verity Stothard

Ah gotcha! Thanks for the tip 👍