BillyBob
BillyBob
Explore posts from servers
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
@erik.gh Thanks for your help. I solved it anyway. see the above ^
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
I solved it. This was due to having use server at the top of my server.ts file for interacting with tRPC on the server side. I replaced it with import server-only to discover this issue I followed the error to the code within node_modules node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@trpc/client/dist/createTRPCClient.mjs added some debugging like so:
*/ function createTRPCClientProxy(client) {
return createFlatProxy((key)=>{
if (client.hasOwnProperty(key)) {
return client[key];
}
if (key === '__untypedClient') {
return client;
}
return createRecursiveProxy(({ path , args })=>{
const pathCopy = [
key,
...path
];
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
const fullPath = pathCopy.join('.');
console.log({client})
console.log({procedureType})
console.log({fullPath})
console.log({pathCopy: pathCopy.pop()})
if (!client[procedureType]) {
return;
}
return client[procedureType](fullPath, ...args);
});
});
}
*/ function createTRPCClientProxy(client) {
return createFlatProxy((key)=>{
if (client.hasOwnProperty(key)) {
return client[key];
}
if (key === '__untypedClient') {
return client;
}
return createRecursiveProxy(({ path , args })=>{
const pathCopy = [
key,
...path
];
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
const fullPath = pathCopy.join('.');
console.log({client})
console.log({procedureType})
console.log({fullPath})
console.log({pathCopy: pathCopy.pop()})
if (!client[procedureType]) {
return;
}
return client[procedureType](fullPath, ...args);
});
});
}
From here I got a new error. Which was saying the server.ts tRPC connecter was exporting a non-async function, which you cannot do if marking the file at the top with use server I removed the use server from the top, replaced with import server-only removed the debugging lines added as shown above and it worked.
22 replies
TtRPC
Created by BillyBob on 3/24/2024 in #❓-help
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11 ] [ NextJS v14.1.X ]
I solved it. This was due to having use server at the top of my server.ts file for interacting with tRPC on the server side. I replaced it with import server-only to discover this issue I followed the error to the code within node_modules node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@trpc/client/dist/createTRPCClient.mjs added some debugging like so:
*/ function createTRPCClientProxy(client) {
return createFlatProxy((key)=>{
if (client.hasOwnProperty(key)) {
return client[key];
}
if (key === '__untypedClient') {
return client;
}
return createRecursiveProxy(({ path , args })=>{
const pathCopy = [
key,
...path
];
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
const fullPath = pathCopy.join('.');
console.log({client})
console.log({procedureType})
console.log({fullPath})
console.log({pathCopy: pathCopy.pop()})
if (!client[procedureType]) {
return;
}
return client[procedureType](fullPath, ...args);
});
});
}
*/ function createTRPCClientProxy(client) {
return createFlatProxy((key)=>{
if (client.hasOwnProperty(key)) {
return client[key];
}
if (key === '__untypedClient') {
return client;
}
return createRecursiveProxy(({ path , args })=>{
const pathCopy = [
key,
...path
];
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
const fullPath = pathCopy.join('.');
console.log({client})
console.log({procedureType})
console.log({fullPath})
console.log({pathCopy: pathCopy.pop()})
if (!client[procedureType]) {
return;
}
return client[procedureType](fullPath, ...args);
});
});
}
From here I got a new error. Which was saying the server.ts tRPC connecter was exporting a non-async function, which you cannot do if marking the file at the top with use server I removed the use server from the top, replaced with use server-only removed the debugging lines added as shown above and it worked.
7 replies
TtRPC
Created by BillyBob on 3/24/2024 in #❓-help
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11 ] [ NextJS v14.1.X ]
No description
7 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
No description
22 replies
TtRPC
Created by emil on 7/5/2023 in #❓-help
TypeError: client[procedureType] is not a function
thanks @emil Here is my current issue: https://discord.com/channels/867764511159091230/1221402424405790780 If you can help in any way its appreciated
16 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
ive been investigating this with a senior friend of mine just now. It makes no sense at all. Its tRPC which is erroring but only when I upgrade NextJS past 14.1. We can see that the tRPC request within the middlware runs as expected but its when trying to render a RSC component with a tRPC call in it
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
done a pnpm store prune as well
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
No description
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
hm i just did a fresh git clone to a new folder and tested again and still getting the same error
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
ok so it works for you as expected? could you actually get a the /movies page up for example?
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
no wait i didnt push it...
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
its when i upgrade next it starts erroring
22 replies
TTCTheo's Typesafe Cult
Created by BillyBob on 3/24/2024 in #questions
Server Error: client[procedureType] is not a function [ tRPC v10.45.2 OR v11] [ NextJS v14.1.X ]
Hey @erik.gh thanks. But i think the latest pushed version is downgraded to nextjs v14.1.0
22 replies
TtRPC
Created by emil on 7/5/2023 in #❓-help
TypeError: client[procedureType] is not a function
because in all the examples they access the appRouter in there, but if they are separated then how can that be done
16 replies