Releasestanstack-fetch 1.7.0: doctor CLI, Solid, Angular, Svelte
Health-check with tanstack-fetch doctor, real Solid/Angular/Svelte adapters, migrate scaffolds, and a docs Framework picker.
Read the postOctober 7, 2026
If you use TanStack Query, your queryFn already wants three things:
isError / error work)AbortSignalMost HTTP clients need adapters for that shape. tanstack-fetch migrate scans axios / ky / ofetch / $fetch / raw fetch, applies safe rewrites, and optionally scaffolds your framework.
Full reference: Migrate guide.
npm install tanstack-fetch@1.6.3// before — axios
queryFn: async ({ signal }) => {
const res = await axios.get('/users', { signal, params: { page: 1 } })
return res.data
}
// after
queryFn: ({ signal }) => api.get<User[]>('/users', { signal, query: { page: 1 } })// before — Nuxt $fetch
await $fetch('/users')
await $fetch('/users', { method: 'POST', body: { name: 'Ada' } })
// after
await api.get('/users')
await api.post('/users', { body: { name: 'Ada' } })One client. Data in, FetchError out, signal first-class.
# Dry run
npx tanstack-fetch migrate --from axios --dir ./src
npx tanstack-fetch migrate --from all --dir ./src
# Apply + framework scaffold
npx tanstack-fetch migrate --from axios --framework react --dir ./src --write
npx tanstack-fetch migrate --from ofetch --framework nuxt --write
npx tanstack-fetch migrate --from fetch --framework nextjs --write| Flag | Meaning |
|---|---|
--from | axios | ky | ofetch | fetch | all |
--framework | react | vue | nuxt | nextjs |
--provider / --no-provider | React: include / skip FetchProvider (interactive default: no) |
--write | Apply safe transforms + write scaffold |
--no-scaffold | Skip scaffold files (honored with --framework too) |
--write is conservative: safe patterns rewrite; interceptors and odd edge cases stay in the report.
Alias: npx tanstack-fetch migrate-axios → --from axios.
| From | To |
|---|---|
axios.create({ baseURL }) | createFetch({ baseUrl }) |
axios('/users') / axios.get | api.get |
axios params / ky searchParams | query |
(await axios.get(…)).data / .json() | data returned directly |
$fetch(url) / ofetch(url, { method }) | api.get / api.post / … |
isAxiosError / ofetch FetchError | isFetchError / FetchError |
Also covered: import * as axios, require('axios'), instance clients after create / ky.create, void fetch / .then chains (report-first for raw fetch), axios.defaults (manual finding).
| Framework | Files |
|---|---|
react | src/lib/api.ts, src/queries/users.ts (+ optional provider) |
vue | api.ts + plugin |
nuxt | lib/api.ts, plugin, composables/useApi.ts |
nextjs | client api.ts + api.server.ts (ssr-forward + cookies) |
For React, --write asks whether to include FetchProvider (default no). Prefer { client: api } for useSse. Skip the prompt with --no-provider or --provider.
out / .cache / vendor / …baseURL / prefixUrl only inside createFetch({ … })res.ok / response.ok (not unrelated .ok)--scaffold paths outside the project rootnpx tanstack-fetch migrate --from all --dir ./src
npx tanstack-fetch migrate --from all --framework react --write --no-providerSee also: Migrate · Comparison · Getting started
Releases·1 min read
Health-check with tanstack-fetch doctor, real Solid/Angular/Svelte adapters, migrate scaffolds, and a docs Framework picker.
Releases·11 min read
tanstack-fetch 2.2.1 fixes 31 bugs: relative baseUrl, createTRPCFetch from npm, SSE reconnects with Last-Event-ID, SSR leaks in Svelte and Vue, a DevTools XSS.
Releases·3 min read
tanstack-fetch 2.1.0: abort during a retry delay, literal colons in paths, a safer refresh-token race, no stream-body retries, plus array query values.