#Vercel deploy invalid header error

6 messages · Page 1 of 1 (latest)

pure flare
#

Hey, was wondering if anyone has encountered this error before? Happens when I try to deploy to Vercel. It builds fine locally and npm run dev also works, checked all my api calls and middleware, but still having trouble locating where it's coming from. Any ideas would be much appreciated!

value in header item must be string for route {"source":"/api/:path*","headers":[{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Allow-Origin"},{"key":"Access-Control-Allow-Methods","value":"GET,DELETE,PATCH,POST,PUT"},{"key":"Access-Control-Allow-Headers","value":"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"}]}
Error: Invalid header found
Error: Command "npm run build" exited with 1

modern garnetBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

pure flare
#

uh ... somehow it works in production now, but the preview build still fails. I guess not critical, but if anyone has any info on that, I'd still be keen to hear it.

dreamy swan
#

@pure flare Do you have the code snippet for where this error is coming from? Also how are you trying to launch to Vercel

pure flare
#

no thats exactly the problem. usually I can identify the bug using stack trace or other methods, but in this case I literally copied all the information I have. But seems to be all good, the production deployment seems to run fine now, just the preview not working correctly.
im deploying directly through a github repo

dreamy swan