-
-
Notifications
You must be signed in to change notification settings - Fork 805
TS error Excessive stack depth comparing types when trying to wrap $fetch #470
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Environment
- Operating System:
Darwin - Node Version:
v16.15.1 - Nuxt Version:
3.0.0-rc.8 - Package Manager:
npm@8.11.0 - Builder:
vite - User Config:
runtimeConfig,css,vite,typescript,modules,unocss - Runtime Modules:
@unocss/nuxt@^0.44.7,@vueuse/nuxt@9.1.1 - Build Modules:
-
Reproduction
export const wrappedFetch: typeof $fetch = (request, opts?) => $fetch(request, opts)
wrappedFetch.raw = (request, opts?) => $fetch.raw(request, opts)Describe the bug
In Nuxt 3.0.0-rc.8, when trying to wrap the $fetch method in a custom method with the same type signature (to set default options for example), typescript throw an Excessive stack depth comparing types error, forcing me to add // @ts-ignore on the line before.
This only happens for $fetch. useFetch can be wrapped without errors.
Is it normal ?
Additional context
No response
Logs
No response
Reactions are currently unavailable