So I have been trying to deploy my website for the past 4 days and couldn’t manage to make it work. I finally found a way to deploy a NextJS website, migrating to vercel. I’m still reporting you the bugs I found so you can fix it.
At first I couldn’t even deploy my website. It didn’t have a publish repository anymore. You can go to your deploy settings to add one (.next for nextjs SSR projects). This is caused by a recent update, Netlify decided to change things without notifyng customers…
Now my website successfully deploys but i’m facing blank pages (with some HTML & no JS or CSS).
This happens when you server-side load a page. Plus, the problems occurs on any URL but the 404 / 500 (which have custom routing on NextJS framework). Lastly, when you land on the 404 / 500 page, you can successfully go back to any page and they will display JS & CSS.
So what did I try thinking that I was the problem ?
- Changing the publish repository
- Changing the netlify/next-plugin version (which leads to other bugs)
- Clearing all caches
- Rolling back to old commits that worked and … no longer ?
- Contacting the support that didn’t provide sufficient help
- Downloading my deployment folder and searching in files the problem
- Migrating to Vercel to see if the problem came from Netfliy, and… guess what, it does.
It seems that the .html files built are lacking any sort of CSS & JS and is only bundling HTML.
Sorry for this kind of salty post. Sorry for my english. I hope it will help others who are facing this problem for days and can’t deploy their site. I hope Netlify will correct this quick.