MichaelJC91
MichaelJC912mo ago

React app not inferring trpc client correctly

I have a monorepo with a packages folder that contains my api. That gets installed in a next js app, as well as a widget built in react using vite. All of a sudden my react app is not inferring my router correctly saying that property does not exist on type never. What exactly is happening here? I've added a few screenshots of my configs
No description
No description
No description
No description
13 Replies
mh
mh2mo ago
I think you may have the same issue as me https://discord.com/channels/867764511159091230/1296744845305450546/1296744845305450546. I have not found a solution yet but it looks like we have a very similar repo structure. mono repo with a shared package but router type is inferred as never
MichaelJC91
MichaelJC91OP5w ago
Yeah, I've tried cleaning all of my workspsaces which has worked in the past, but nothing this time @mh do you use Bun? I switched to pnpm and it works now
mh
mh5w ago
no, I use pnpm as well. our project is a turbo mono repo using pnpm. All our types work using v 10.45.2 but moving over to v11.x immediately breaks type inference for us (no other code changes)
MichaelJC91
MichaelJC91OP5w ago
Is the package version for trpc set to 11 or next?
mh
mh5w ago
was set to 11.0.0-rc.586
shikishikichangchang
fyi trpc version 11.0.0-rc.383 and beyond breaks turbo
mh
mh5w ago
ah interesting. I will try a version prior to rc-383 and report back. thanks for the heads up.
MichaelJC91
MichaelJC91OP5w ago
What exactly about it breaks turbo? Also, is there a list of all the rc's I can see?
mh
mh5w ago
npm
@trpc/server
The tRPC server library. Latest version: 10.45.2, last published: 7 months ago. Start using @trpc/server in your project by running npm i @trpc/server. There are 409 other projects in the npm registry using @trpc/server.
MichaelJC91
MichaelJC91OP5w ago
Ah perfect. Thank you!
mh
mh5w ago
np
MichaelJC91
MichaelJC91OP5w ago
How'd you go with downgrading?
mh
mh5w ago
I have not done it yet, will attempt later this evening no luck with rc-382 either for me. stuff still gets typed as 'never'. for the moment we are stuck with 10.45.2. I will try to spend some time narrow down the issue a bit more but v11.x seems unusable for us atm.