Migrate from the Release Candidate
@tanstack/react-start 1.169 is the first stable release of TanStack Start. Upgrading from a release candidate means replacing the removed APIs below and checking the behavior changes that apply to your app.
Vite 8
Start requires Vite 8 when you build with Vite. Upgrade with Vite's migration guide.
Removed APIs
| Removed | Use instead |
|---|---|
@tanstack/nitro-v2-vite-plugin | nitro() from nitro/vite. See Nitro hosting. |
useSession | A session library such as iron-session. See Session Management. The new library cannot read existing Start session cookies: use a new cookie name and sign users in again, or test a migration that reads the old cookies first. |
.inputValidator() on server functions and middleware | .validator(), which takes the same validator. |
Errors
- A handler returned by
createStartHandler(...)now rethrows the original error.createServerEntryconverts errors to responses, and the built-in entry already uses it. In a custom entry, catch inside thecreateServerEntrycallback andreturn handleStartError(error)or rethrow. See Error Handling. - Uncaught errors produce a generic JSON body with a status from
400to599(500by default), even if a success status was set before the error. Return aResponsewhen an endpoint needs a specific error payload. - A server-function call rejects with whatever was thrown, including a
Responseand falsy values such asundefined. Return aResponseto resolve the call with it. See Raw Responses. - Errors thrown by request middleware during a server-function call are sent to the client with their message, and their status is no longer always
500.
Responses
- Response helpers override the response you return or throw.
setResponseStatus(401)followed by returning a200response sends401. setResponseHeader('set-cookie', cookie)replaces all outgoing cookies. UsesetCookieorappendResponseHeader('set-cookie', cookie)to add one.setResponseStatusignores codes outside200-599and warns outside production.- Serialized server-function replies never carry
Location,Content-Encoding, orContent-Lengthfrom helpers, and ignore a helper204,205, or304. Useredirect()to redirect.
Requests and middleware
getRequestHeader(name)returns''for a header that is present but empty, andundefinedonly when it is missing.- A path with invalid percent-encoding, such as
/%E0%A4%A, gets400 Bad Requestbefore your server entry or middleware runs. - When no function middleware sends context,
sendContextisundefinedinstead of{}.