trpc error when deploying t3 app in vercel
I've been building an app for a while now and have recently been inspired it to convert it to t3 stack. Everything works locally, but when I deploy it to vercel I get this error every time i attempt to hit a trpc endpoint:
I'm kinda lost how to debug this. Anyone have any ideas?
4 Replies
In the error message it says there is something wrong in you
server/pages/api/trpc/[trpc].ts
at 1515:29.
What does your code say there?
My assumption would be you're trying to JSON.parse()
something that's depending on one of your env vars which is not set correctly in productionmy code is pretty much straight from t3
and its certainly not 1500 lines llong
thats why im so confused
ayyyy i fixed it. sorry for the noise
TL;DR when setting environment variables in vercel dont include the quotes
and i figured it out by running
npm run start
to build the js files which DID include the giant [trpc].js file
so then i could look at the line it was running which was actually froma. completely different fileBuilds being builds 🤷
I’ve spent soooo long with that same issue 🤦♂️…. Those stupid quotes