Hinky
126 routers | TS7056: inferred type node exceeds - Multiple Providers?
Hello hope you are all well.
quick info:
env: node 20, pnpm, trpc^11.0.0-rc.466, monorepo.
Everything in my monorepo is built/typescript declarations (otherwise autocomplete is a snail).
I have 126 routers (didn't realise it was so much)
error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
Hasnt been an issue until very recently, and as far as i can tell its the limit of input/output, (if i comment out some output from a endpoint, it will be okay. (doesnt matter specifically what data, just reduce any output seems to fix it))
So ive basically just accepted im at hard limit, and thinking solution is to have multiple providers. with:
https://github.com/trpc/trpc/pull/3049
However things have changed since that example, (example no more context)
Ill put my attempt at the bottom of post
having multiple providers, i can confirm, has got rid of the TS7056 issue.
However, doesnt seem to matter what i do, all endpoints will go to one httpBatchLink.
Ive got example below of what ive done. (they all go to auth endpoint, anything but auth should be going to gen endpoint)
So if anyone has a solution or recommendation, i will do it. I dont mind doing multiple providers or something else.
My code is private and my life ahah but will share with maintain if that helps. Also more than happy to pay for anyones solution here.
Ill put my attempt in separate comment
2 replies