DEV Community

Discussion on: Using WordPress as a headless CMS with Next.js

Collapse
 
samuelkobe profile image
Samuel Kobe • Edited

Hello, thank you for writing such a detailed Article. I am having trouble getting up and running after adding the new directories and files above. When trying to view the posts on the /blog page at the step titled 'Checking the output' I am getting the following error after following the "blog articles page" link.

Screenshot: dev-to-uploads.s3.amazonaws.com/i/...

EDIT1:

I was able to get it working buy adding

export default Blog
Enter fullscreen mode Exit fullscreen mode

before

export async function getStaticProps() {
  const allPosts = await getAllPosts();
  return {
    props: {
      allPosts
    }
  };
}
Enter fullscreen mode Exit fullscreen mode

Is this correct?

Collapse
 
setoelkahfi profile image
Seto

This is correct.