When deploying in Netlify or Vercel you need to specify a folder name that is associated with your publish directory.
In my case it is .next directory/folder.
Here I'm sharing a interface of build settings in Netlify.
Make sure you add this publish directory in your deploy settings.