Jaaneek
Jaaneek12mo ago

TRPC not working on multi tenant app

Everything works on localhost. When I deploy it on the vercel None of the mutations work. Every query/mutation always return 200 but they contain a weird response:
{"0":{"result":{"data":{"json":null,"meta":{"values":["undefined"]}}}}
}
{"0":{"result":{"data":{"json":null,"meta":{"values":["undefined"]}}}}
}
The error is:

Error: Missing result at https://app.feedbackvote.com/_next/static/chunks/3403-60a8e951dcfe8770.js:1:32728

Error: Missing result at https://app.feedbackvote.com/_next/static/chunks/3403-60a8e951dcfe8770.js:1:32728
here is the app (only twitch login works) https://app.feedbackvote.com/boards All of the server side queries that are made with TRPC work
t3-app-dir-supabase
Boilerplate for t3-app-dir-supabase.
No description
4 Replies
Nick
Nick11mo ago
That response is just the format superjson uses so that looks fine Might be your client isn’t set up right? I’m not really a NextJS expert
adambarito
adambarito11mo ago
@Jaaneek did you ever come to a fix on this issue? I'm having a similar issue in production (no issues on localhost) where queries & mutations fail with the same error. Weirdly, if I refresh the page/keep trying in production, sometimes they work.
Jaaneek
JaaneekOP11mo ago
I had a mistake in the code. I didn’t await/return a promise on mutations so they resolved too quickly and the query failed. It was hard to debug because it worked with local host and lambda functions but failed on vercel edge runtime, because they are killing the server as soon as the function ends. Lambda/local host lives beyond that so I couldn’t detect a problem there
adambarito
adambarito11mo ago
Thanks for the quick reply! Do you recall at what level you weren't awaiting/returning the promise? From logging in the route, it does look like the response is being generated in the handler, but only response headers are making it back to the client. Some context: logging in the handler: edge api handler :: response.json() { 0: { result: { data: { json: { success: true } } } } } console error on the client: TRPCClientError: Missing result at a.from (https://app-650a44d19-barely.vercel.app/_next/static/chunks where I'm currently working on https://github.com/barelylabs/barely/pull/35
No description

Did you find this page helpful?