When upgrading to v11, the AppRouter in .d.ts is any
Hello !
I just tried to upgrade from trpc v10 to trpc v11.
I am on a monrepo, the the tRPC router type is built as part of a package.
In the code, I simply export procedures :
When I hover over AppRouter, everything is fine :
However, when I'm building the type I get this in .d.ts :
So this seem to work great, however, when I hover AppRouter, it's type any.
The root of the issue seems to be that typescript fails to resolve type in the unstable import such as :
import('@trpc/server/dist/unstable-core-do-not-import').BuiltRouter
Is there anything I need to change in my tsconfig.json ?
The source one :
Thank you !2 Replies
I suspect this is your issue: https://github.com/trpc/trpc/issues/6753
Check that bug report for a patch you can use.
GitHub
bug: generated
.d.ts
files leaking un-exported types · Issue #67...Provide environment information System: OS: macOS 14.5 CPU: (12) arm64 Apple M2 Max Memory: 73.41 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/nod...
using
patch-package
or pnpm patch