Queries break when in production on Vercel; work on localhost
The query is called like this:
every query works on localhost, but once it's deployed to Vercel they all give this same error
![](https://utfs.io/f/141c6a69-61f2-47f4-b9d6-294f04ca249a-4pl4mu.png)
![](https://utfs.io/f/8172f65c-e905-4fd2-804d-d50756e923cc-4pl4mu.png)
19 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yup it is
![](https://utfs.io/f/abffa275-1936-4538-8144-af269028514c-4pl4mu.png)
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
hm true. and that does happen sometimes if it has an error. it returns the html from _document.tsx. i thought it was happening every time but when it's not having an error it only returns the json from trpc so i never looked into it
this is the response
![](https://utfs.io/f/a8b0a57d-c9d6-42d7-89ba-172c060a24a1-4pl4mu.png)
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
no this is for the api route
![](https://utfs.io/f/4cfa6e71-0253-4d6a-a35b-f3929c1632ac-4pl4mu.png)
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i don't think so, everything has been working before. just for whatever reason this recent push caused these problems
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ah
Oh okay so that makes sense. the html comes when there's an error because vercel puts up this 500 page
![](https://utfs.io/f/6aa67c22-c478-42b1-8912-b6633198a61e-4pl4mu.png)
i found a commit where it all works, the one right after is what has things break. later today ill look at the difference
an interesting thing i found is that on the deployments i get this error, it seems like vercel is hitting a cache...
![](https://utfs.io/f/e9c2e4cc-7f4d-42e0-ab67-8aeed051277c-4pl4mu.png)
![](https://utfs.io/f/582a2c56-98f0-4697-8ab1-929c356cec51-4pl4mu.png)
maybe since it's returning a page idk
yea i have no clue, nothing really changed from the commit that worked to the commit that broke it
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes
in dev and build mode
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
not oss
if i'm stuck on this though i could make some repo
@oscartbeaumont after more debugging I found that the error was being caused by not setting up an env variable on vercel