Next.js Discord

Discord Forum

Deployment failing due to prerendering error

Answered
West African Crocodile posted this in #help-forum
Open in Discord
Avatar
West African CrocodileOP
I am trying to deploy a NextJS app on Vercel. This app also has a backend whose endpoints are being called in my components using axios. I am trying to deploy the app but it keeps failing on the prerendering step. From what I understand, it is attempting to execute the api call in my components during this prerendering step. I'm really confused by this, how can it expect these calls to be successful, isn't the server not yet deployed? Wouldn't this always fail?
Furthermore, I set the baseURL for my axios calls in the env file and set it as the would be url of my app on Vercel i.e. https://lym-real-estate-platform.vercel.app/. Idk how to confirm if this is indeed the baseurl for the server or if this is what is causing the issue. Any help would be much appreciated.
And to top it all, I switched my plan from hobby to pro to open a support ticket and now Vercel is not detecting my commits to the deployment branch for auto deploy :/
Image
Image

8 Replies

Avatar
Avatar
West African CrocodileOP
I tried that right after I switched to Pro but it didnt detect the commit to autodeploy.
Avatar
Create a empty commit for deploy by this command
git commit --allow-empty -m "chore: trigger vercel build"
Avatar
West African CrocodileOP
Hmm still not working. Ill dig around a bit and see why switching to Pro has busted my auto deploy. This is really odd
Avatar
West African CrocodileOP
Got it to work, had to change my commit email. Same error though. Do you think it has to do with the baseURL that i set?
Avatar
Are you calling own api calls in your server component? You shouldn't, because it creates a deadlock like your case.
Answer
Avatar
West African CrocodileOP
Ahhhh yeah thats pretty much it. Thank you!