David
David3w ago

Turborepo internal package exported procedure context type `any`

I am working on moving our trpc API to a separate internal package away from our next.js app, but running into an issue where the ctx type is any in the Next.js app. Even though the type is shown when I hover the procedure itself. Any idea what this could be?
No description
No description
11 Replies
Edgar
Edgar3w ago
I got the same message when I was implementing tRPC into my test turborepo and I never got it to work.
David
DavidOP2w ago
Man, that is unfortunate to hear LOL Hope someone else may have a solution
Edgar
Edgar2w ago
I found a solution to your problem
Edgar
Edgar2w ago
GitHub
GitHub - edgar-guzman/small-trpc-example-turbo
Contribute to edgar-guzman/small-trpc-example-turbo development by creating an account on GitHub.
David
DavidOP2w ago
Sick! Could you share what part of this repo solves it / I have to look at? Also feel free to @ me since I may not see it otherwise
Edgar
Edgar2w ago
Yeah I can compress, Do you see the create-context file when viewing the repo? (packages/trpc/src/create-context.ts) and This is one of the way I got this to work and when you hover over the word 'ctx' it should say what typed it is.
David
DavidOP5d ago
This doesn't solve it not working in another package / app though, does it?
Edgar
Edgar5d ago
I use the v11 rc version of tRPC: which is 11.0.0-rc.730
David
DavidOP5d ago
I use 11.0.1
Edgar
Edgar4d ago
Interesting I will try and use the v11 instead of rc Let's me know if this work, I bump up version to 11.0.1
Edgar
Edgar4d ago

Did you find this page helpful?