TypeError: client[procedureType] is not a function
Has anyone encountered this error before? I'm trying to implement an adapter for Auth.js that can communicate with my backend via tRPC proxy client but I keep getting this error for some reason.
This is how i call my route:
And this is my client:
Solution:Jump to solution
I used sveltekit so the setup was a bit different and backend was just normal medusa.js node application, the methods are just built like this on the client:
```ts
function StorefrontApiAdapter(client: AuthClient): Adapter {
return {
async createUser(user) {...
10 Replies
@emil Did you ever solve this?
Oh yeah managed in the end!
what as the issue ? i am getting the same problem when upgrading next to anything newer than 14.1.0
or do you have a link to your repo?
The repo is unfortunately private for work, I can check tmrw what the issue was exactly (off the top of my head it was mismatched trpc versions between my front end and backend)
Thanks! the versions are tthe same at least in my case.
Do you guys have separated BE/server and client ?
Ooh interesting, yeah they are separate
same
Are you using NextJS? how did you setup your api/trpc/[trpc] if so
because in all the examples they access the
appRouter
in there, but if they are separated then how can that be doneSolution
I used sveltekit so the setup was a bit different and backend was just normal medusa.js node application, the methods are just built like this on the client:
and then that is imported by a the authjs middleware to be used as a custom adapter:
the config.client is just the tRPC
thanks @emil
Here is my current issue:
https://discord.com/channels/867764511159091230/1221402424405790780
If you can help in any way its appreciated
oh nice you solved it as well, very nice!