The inferred type of 'trpc' cannot be named without a reference ...
Hey everyone,
I just changed around the structure of my monorepo where I now have my nextjs application inside of
apps/nextjs
and my trpc server code in packages/api
.
Doing this however gives me this error which definitely seems related to types not being shared properly between the two packages. I am using yarn (1.22.19) workspaces.
I saw some other posts on here that seemed related but no matter what I did I couldn't get the error to disappear .. what is strange as well is that it is saying it cannot be named without a reference to the react query trpc package but only when I use the AppRouter type2 Replies
Having the same issue. Did you end up solving this?
Solved it somehow by having this in the tsconfig:
Open a minimal repro please and I'm pretty sure we can help.
declarationMap false shouldn't be required
This stuff is usually a bit unintuitive to fix - can be that you need to move some deps to the root package.json or that we need to export more stuff inside trpc itself or that you need to reexport trpc libs in a package