CalebBarnes / nextwp

http://nextwp.org/
7 stars 0 forks source link

Error occurred prerendering page "/blog" when there are no posts in WP #48

Open CalebBarnes opened 5 months ago

CalebBarnes commented 5 months ago

@nextwp/core: 0.0.2

WP has no posts, but it has a /blog page.

generateStaticParams postTypes is ["pages"]

TypeError: Cannot read properties of undefined (reading 'posts')

Somewhere we are trying to access .posts on undefined.

CalebBarnes commented 5 months ago

Deleting the blog page seemed to resolve the issue.

But if there is a new site with a blog page and no posts yet then it looks like it will break even if generateStaticParams does not have "posts" post type.