www/docs/further/faq.mdx
Collection of frequently asked questions with ideas on how to troubleshoot & resolve them.
Feel free to contribute to this page with improvements or create a new discussion on GitHub if you have a question that isn't answered here. Also, have a look through the GitHub Discussions and our Discord if your question isn't answered here.
any everywhere"strict": true in your tsconfig.json@trpc/*-versions match in your package.json>=5.7.2)package.jsonAdd these settings to your .vscode/settings.json in your project root to make sure your editor is using the same TypeScript version as your package.json:
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
We highly recommend committing this file to your repo so your colleagues also get the same experience.
Context?See Context Extension.
Yes. tRPC is very stable and is used by thousands of companies, even big ones like Netflix & Pleo are using tRPC in production.
This is a difficult question to answer, but since tRPC doesn't have any build step, it's unlikely that the problem is on tRPC's side.
Here are some things to check:
@trpc/* across all your projects"strict": true in all your tsconfig.jsonstsconfig.json files without a bundled server monorepo package, make sure you have "paths": [...] in your client tsconfig.json like your server tsconfig.json, so that the client can find the same file.You can also have a look at our Awesome tRPC-collection to find several open-source projects that are using tRPC in a monorepo.
No, a monorepo is not mandatory but you will lose some of the benefits of using tRPC if you don't use it since you will lose guarantees that your client and server works together.
One way you can leverage tRPC is to publish a private npm package with the types of your backend repo and consume them in your frontend repo.
Related discussion: https://github.com/trpc/trpc/discussions/1860
No, not currently, in order for tRPC to do that automatically, we need something called "Higher kinded types" which is not yet supported in TypeScript.
Related discussion: https://github.com/trpc/trpc/discussions/2150
No, but you can use base procedures instead, which offers more flexibility than if this was done on a per-router-level.
Yes, tRPC works with Next.js App Router & React Server Components. See the Next.js App Router setup guide for the recommended approach.
unstable_? {#unstable}tl;dr: Yes!
If you encounter a feature in tRPC that is marked as unstable_ it means that the API is unstable and might change in minor version bumps, but:
unstable_-feature, they will be included in the release notes (& you'll see type errors)#🧪-unstable-experimental-features on our Discordexperimental_? {#experimental}If you encounter a feature in tRPC that is marked as experimental_ it means that the API is unstable and is very likely to change during any bump of tRPC.
We do, however, love input! Please report any suggestion on the API design or issues in the #🧪-unstable-experimental-features on our Discord.
Yes, tRPC is very strict with semantic versioning and we will never introduce breaking changes in a minor version bump.
With this, we also consider changes on exported TypeScript types as major changes, apart from ones marked as @internal in the JSDoc.
When tRPC started and had very few users, we often iterated on the API design while being strict with semver.
We expect the API to be stable now and are planning to release codemods for any breaking changes in the future, just like we did with the v9->v10 upgrade.
Please write a feature request on GitHub, write in GitHub Discussions, or Discord. You're also free to suggest improvement of this page or any other page using the "Edit this page" button at the bottom of the page.