Menu

tanstack-fetch 2.2.1: I audited every entry point and fixed 31 bugs
πŸ“°

tanstack-fetch 2.2.1: I audited every entry point and fixed 31 bugs

DEV Community: reactΒ·Mohammad GarmabiΒ·2 days ago
#qYInjr9a
#devtoreact#devto#dev#tanstack#fetch
Reading 0:00
15s threshold

tanstack-fetch 2.2.1 adds no new features. I went through every entry point (core, /sse , /trpc , the framework adapters, DevTools, and the CLI) and fixed 31 bugs . Each fix has a regression test.

npm install [email protected]

Enter fullscreen mode

Exit fullscreen mode

If you haven't seen it before: tanstack-fetch is a small, typed fetch client built for TanStack Query. It has guides for React, Vue, Next.js, Nuxt, Solid, Svelte/SvelteKit, Angular and TanStack Start.

Here are the fixes most likely to have affected you.

1. A relative baseUrl actually works now

const api = createFetch ( { baseUrl : '/api' } ) await api . get ( '/users' ) // 2.2.0 β†’ TypeError: Invalid URL // 2.2.1 β†’ GET https://your.site/api/users

Enter fullscreen mode

Exit fullscreen mode

In the browser it resolves against location.href . On the server you get a clear error asking for an absolute baseUrl , so it no longer fails with a vague message.

2.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.