Blog pages rendered perfectly on development mode but doesn't work on build #16849
Unanswered
ksoenandar
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm building a personal website with a blog section on the page. I've done all the development locally and everything works and I wanted to try to deploy it to Vercel. However, the build process continuously fails at generating the blog pages, which works perfectly in the development mode.
Here is the /blog/[id].jsx code
I keep on getting the following error
As I said, this code works perfectly fine in development mode. I tried console logging it every step of the way. So the getStaticPaths worked fine, it passed the correct path to the getStaticProps function. The getStaticProps also works fine as it returns the correct data. However, oddly enough, if I console logged "body" outside of the render function, I can see the data. But the error message suggests to me that somehow it's being returned as undefined.
Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions