tRPC
Backend & Infra🧙♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
Release History
v11.10.01 fix2 featuresThis release introduces enhancements for error handling in local links and adds batch indexing support for server-side procedures and middleware, alongside a fix for client connection parameter encoding.
v11.9.01 featureThis release introduces an experimental option for WebSocket encoding and welcomes new contributors.
v10.45.41 fixThis patch release fixes a corruption issue in the package.json file to ensure proper package installation.
v10.45.31 fixA security patch release addressing a vulnerability identified in GHSA-43p4-m455-4f4j.
v11.8.13 fixesThis patch release focuses on bug fixes for subscription handling, TanStack React Query prop tracking, and Fastify type definitions.
v11.8.01 fix1 featureThis release introduces streaming support for AWS API Gateway REST APIs and addresses a security advisory regarding cross-site scripting.
v11.7.21 fixThis patch release fixes a bug where SSE options were not correctly applied when using merged routers in tRPC server.
v11.7.11 fixThis patch release addresses a bug in the TanStack React Query integration regarding undefined key prefixes.
v11.7.02 fixes1 featureThis release introduces prefix options for Query and Mutation keys in TanStack React Query and includes fixes for websocket initialization and server type exports.
v11.6.01 fix1 featureThis release introduces support for the Precondition Required response code and fixes a TypeError affecting httpBatchStreamLink in React Native.
v11.5.13 fixesThis patch release focuses on minor bug fixes for the server and client packages, including JSDoc corrections and the export of the DataTransformer interface.
v11.5.02 featuresThis release introduces the ability to access the procedure path within resolver options and updates type inference to prefer the Standard Schema specification.
v11.4.42 fixes1 featureThis patch release introduces support for TypeScript 5.9 and fixes specific issues related to httpBatchLink transformations and monorepo type definitions.
v11.4.32 fixesThis patch release addresses a missing internal export and resolves a memory leak warning (MaxListenersExceededWarning) specifically affecting the Fastify adapter.
v11.4.21 fixThis patch release fixes a build target issue to ensure proper support for React Native.
v11.4.11 fixVersion 11.4.1 is a patch release that fixes the export condition order to ensure correct package resolution.
v11.4.01 fix1 featureThis release transitions localLink to an unstable status and migrates the build system from Rollup to Rolldown via tsdown.
v11.3.11 fixThis patch release fixes a type inference bug in the client related to the serialization of JSON-like return types.
v11.3.01 fix1 featureThis release introduces the localLink feature for the tRPC client and updates TanStack Query peer dependencies to their latest versions.
v11.2.01 fix2 featuresThis release introduces AWS Lambda response streaming and support for 402 HTTP status codes, alongside a fix for subscription connection state handling in the TanStack React Query integration.
v11.1.41 fixThis patch release fixes a type inference issue in the TanStack React Query integration where initialData was being incorrectly inferred.
v11.1.35 fixes1 featureThis patch release focuses on bug fixes for WebSocket reconnection, SSE stream consumption, and Vue Query integration, while also exposing procedure metadata on the server.
v11.1.21 fixThis patch release focuses on fixing type errors specifically related to the TanStack React Query integration.
v11.1.01 featureThis release introduces a new configuration option for the client-side retryLink, allowing developers to specify a custom retry delay in milliseconds.
v11.0.42 fixesThis patch release focuses on client-side bug fixes, specifically addressing generic type issues in TRPCConnectionState and restoring deprecated link prefixes.
v11.0.36 fixesThis release focuses on security updates for Next.js and Vite, adds support for React 19.1, and includes minor UI alignment fixes.
v11.0.23 fixes1 featureThis patch release includes security updates for Vite and Next.js, along with a fix for the @trpc/upgrade tool and improved flexibility for subscription options.
v11.0.11 fix2 featuresThis patch release adds new boilerplate examples for Fastify and Nuxt, and improves compatibility with Effect-based standard-schema parsers.
v11.0.0Breaking3 fixes4 featurestRPC v11 introduces significant performance optimizations, improved Next.js App Router support, and raises the minimum requirements for Node.js and TypeScript.
Common Errors
UnhandledTrpcError1 reportUnhandledTrpcError usually arises when an error is thrown within a tRPC procedure that isn't caught and properly transformed into a `TRPCError`. Ensure you wrap procedure logic in try/catch blocks, using `throw new TRPCError({ code: 'WHATEVER_CODE', message: 'Helpful error message' })` to surface meaningful errors to the client. For errors originating outside procedures (middleware, global error handlers), verify you construct and throw a `TRPCError` instance to signal an expected error state.
TRPCClientError1 reportTRPCClientError usually arises when the server-side TRPC procedure throws an error that isn't properly serialized or handled by the client. To fix it, ensure server-side errors are instances of `TRPCError` from `@trpc/server`, and that your client-side code correctly handles `TRPCClientError` by checking its `TRPC_ERROR_CODE_KEY` to determine the specific server-side error.
StreamInterruptedError1 reportStreamInterruptedError in tRPC often arises when a stream is prematurely terminated by the client (e.g., navigating away) before all data is received. To fix this, ensure your server-side streaming procedure gracefully handles cancellation signals by closing the stream or `AsyncGenerator` when the `signal` is aborted, preventing further data emissions. Additionally, catch any potential exceptions thrown by the underlying stream (e.g., if the resource it's reading from disappears) and ensure they are properly handled and propagated to the client as a trpc error instead of letting them interrupt the main tRPC stream.
Related Backend & Infra Packages
Production-Grade Container Scheduling and Management
Node.js JavaScript runtime ✨🐢🚀✨
Promise based HTTP client for the browser and node.js
A modern runtime for JavaScript and TypeScript.
Deliver web apps with confidence 🚀
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Subscribe to Updates
Get notified when new versions are released