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 configs13 Replies
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
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
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)
Is the package version for trpc set to 11 or next?
was set to
11.0.0-rc.586
fyi trpc version 11.0.0-rc.383 and beyond breaks turbo
ah interesting. I will try a version prior to rc-383 and report back. thanks for the heads up.
What exactly about it breaks turbo?
Also, is there a list of all the rc's I can see?
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.Ah perfect. Thank you!
np
How'd you go with downgrading?
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.