BillyBob
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11 ] [ NextJS v14.1.X ]
Good Morning I am getting the above error when updating to the latest version of NextJS - 14.1.1 through 14.1.4.
The last release that doesn't cause this error is 14.1.0.
I have:
* ensured versions are the same on server and client.
* updated packages
* removed all node_modules and reinstalled.
*
pnpm store prune
,
* deleted pnpm.lock
and reinstalled.
* deleted .next
folder
* latest v18 and v20 of Node.js
It makes no sense at all. Its tRPC which is erroring but only when I upgrade NextJS past 14.1.
I can see that the tRPC request within the middleware runs as expected but its when trying to render a RSC component with a server side tRPC call in it is when I get the error.
full error:
7 replies
tRPC, NextJS 14, createTRPCProxyClient, How can I globally manage errors?
I want to be able to redirect a user when they become unauthenticated. Someone else mentioned to create some NextJS middleware which makes an api call for the user but then that will make an extra API call for every tRPC request. It feels like there should be someway I can centrally manage errors where if tRPC returns an 'UNAUTHORIZED' error for any procedure I can do a redirect to '/login'
I have a monorepo with everything together but the apps will be deployed separately eventually.
22 replies
Help understanding how to deploy tRPC in monorepo.
Hi All,
I read in the FAQ that most benefits come from using tRPC in a monorepo. So if i want to build an app, that for example used tRPC with Fastify and a nextJS frontend. How exactly would this be deployed? Would it still work as expected if deploying the client and server separately to different ec2 instances for example. Am i right in thinking that the benefit comes with the type safety during development so how its deployed does not really matter?
2 replies