Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CalebBarnes opened this issue Feb 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@CalebBarnes
Copy link
Owner

@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 CalebBarnes added the bug Something isn't working label Feb 6, 2024
@CalebBarnes
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant