Build fails Next.js

Hi :wave:

Has anyone been successfully in deploying a Next.js site to Render?

I have tried Deploy a Next.js App | Render · Cloud Hosting for Developers as well as a few other things but either the build always fails or I receive a page with ‘Not Found’.

Really keen to use Render for the frontend.

Thanks!


2 Likes

Hi @stevencmh,

I think I responded to you in another thread but can you share the name of the service with me so I can take a look?

Has anyone been successfully in deploying a Next.js site to Render?

Yes, Next.js works like a charm on Render :slight_smile:

Hey, I was able to deploy but all the image links are broken. Works fine in Vercel. What config settings do you use?

Faced same, have been trying to deploy nextjs app, deployment is getting successful, but on hitting the URL, getting 404 error, have been trying to resolve it from past 24 hours with no success

Hi Tanya,

Have you taken a look at your deploy logs for any clues? Feel free to post them here and I’ll have a look.

You could also review https://render.com/docs/deploy-nextjs-app as a reference to see an good example.

Regards,

Matt

Hey @Tanya_Sethi @stevencmh any update on this? Did you manage to solve it? I am facing the same issue myself

This example, like yarn next export is deprecated.
Now we need to add to the next.config.js:

output: 'export',
images: {
  unoptimized: true,
},

https://nextjs.org/docs/advanced-features/static-html-export

And use for the build only: yarn; yarn build