I have a site agitated-goldstine-6a8d97 that is a simple Next.js demo. The site was building locally and even via
netlify build locally but when deployed it gave the following error:
2:11:33 PM: Unhandled error during request: TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "authorization"
This seemed similar to an error I’d run into locally that was only fixed by deleting the
.next folder with the cache. I tried multiple times to clear cache and deploy on Netlify but with the same result. Realizing that the site built locally, I tried using
netlify deploy and that worked, deploying a deploy preview. So I ran
netlify deploy --prod and that also worked, building the site for production.
The key thing is, this is the exact same code that works but also failed to build. It almost seems like the cache for Next is not getting blown away completely or something, but that’s just a guess.