I had this issue in Production. I deleted the .next folder and npm run build again an restarted the app with pm2 and then it worked.