tRPCttRPC
Powered by
La grande murailleL
tRPC•3y ago•
3 replies
La grande muraille

Losing type inference in vs-code

Hey,
I'm having quite some trouble with type inference today.

I create my client inside of function that returns it with
createTRPCProxyClient<AppRouter>()
createTRPCProxyClient<AppRouter>()


I can clearly see the type of the client object inside of the function.
Most of the times after importing and calling my function from another file, I can't see the type anymore...
What's even more interesting is that IntelliSense does show the paths...

Sometimes I can see the type for a few seconds but this is really rare.

It seems the typescript lsp in not working correctly, it's the only thing i could think of, do you have any ideas of what's happening ?

Version :
- Node : 20.3.0
- tsc : 5.1.6
- @trpc/client && @trpc/server : 10.35.0

The Front-end is a SvelteKit project if this can change anything...
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Difference in type inference for vanilla client?
Jack FischerJJack Fischer / ❓-help
4y ago
Losing type-safety with merged routers
jacobJjacob / ❓-help
2y ago
Complex type inference on router outputs?
ianIian / ❓-help
2y ago
Incorrect type inference with discriminated unions.
dechoDdecho / ❓-help
3y ago