Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type issue with QueryStringAddon and resolve #222

Closed
jsardev opened this issue Mar 6, 2024 · 2 comments
Closed

Type issue with QueryStringAddon and resolve #222

jsardev opened this issue Mar 6, 2024 · 2 comments
Labels

Comments

@jsardev
Copy link

jsardev commented Mar 6, 2024

I've been trying to create a reusable client with automatic expired token refresh.

Unfortunately, when adding the QueryStringAddon something's getting broken with the typings and I can't create a global resolve with unauthorized.

I'm getting this TS error:

The 'this' context of type 'Wretch<QueryStringAddon, unknown, undefined>' is not assignable to method's 'this' of type 'QueryStringAddon & Wretch<QueryStringAddon, unknown, undefined>'.
  Property 'query' is missing in type 'Wretch<QueryStringAddon, unknown, undefined>' but required in type 'QueryStringAddon'.(2684)

Here's a reproduction: https://stackblitz.com/edit/vitejs-vite-5per8h?file=src%2Fapi.ts

Would appreciate any help 🙏

@elbywan elbywan added the bug label Mar 7, 2024
@elbywan elbywan closed this as completed in 99a21a8 Mar 7, 2024
@jsardev
Copy link
Author

jsardev commented Mar 7, 2024

That was fast 😅 Thank you @elbywan 🙇‍♂️

@elbywan
Copy link
Owner

elbywan commented Mar 7, 2024

Hey @jsardev,

I just published v2.8.1 which should now work as expected 🤞.

The request type should now be correct:
Capture d’écran 2024-03-07 à 08 32 32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants