Jaaneek
Jaaneek6mo 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
Nick6mo 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
adambarito6mo 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
Jaaneek6mo 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
adambarito6mo 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
More Posts
TRPCClientError: Unable to transform response from serverHi 🙂 I've just started - so nothing more than boiler plate code but for some reason it doesn't workoptimistic updates tRPC v11 + TanStack Query v5I am reading https://tanstack.com/query/latest/docs/framework/react/guides/optimistic-updates#if-theT3 Stack TRPC used in Server ActionsIs there issues using the server calls of TRPC in a nextjs server action? I am seeing weird issues wHow do I setup subscriptions with websockets in Next.js 14 app router?All I've found were some older examples for the pages router which for me were not very understandabWhy is my tRPC + Next 14 (app router) data fetching pattern not refreshing the UI?### Goals of this post: - to know why my UI is not refreshing after i mutate the backend - tUsing tRPC in Next.js MiddlewareHello, I am quite new to tRPC so forgive me if I'm asking something quite obvious/dumb. I was introneed help refreshing websocketWe currently are using tRPC w/ react and websockets. We’re using the URL of the websocket as the autrouter is crashing when in separate fileWhen i use router merging and have e.g users router in separate file, i import router from trpc.ts aHow do I pass a Generic to a trpc query procedure?I want to to something like this: ```ts type AppIdsWithConfig = typeof kodixCareAppId | typeof calenIs there something to be done about trpc errors and solidjs/seroval?Basically if you `throw error` in trpc route, solidjs seroval fails to serialize it during SSR. I do