Photo by cloudvisual on Unsplash

Next.js + Heroku WTF

Mon Mar 22 2021

After TWO WEEKS of R10 errors, I finally have my site up with my blog! Special thanks to Derik Linch for the answer!

It turns out, deploying a Next.js app to Heroku requires one simple modification, not covered ANYWHERE on Google. In your package.json file, NOT in a Procfile as the official website discusses, replace this line:

"start": "next start"

with this one:

"start": "next start -p $PORT"

THAT'S IT! I am not sure why Heroku needs that slight modification (instead of it being built in), but I am ecstatic that it works! That's all this week.

Happy coding!