\n\n### Describe the bug\n\nWith @hey-api/nuxt the client.ts generated has 2 typescript error with typecheck: true inside nuxt.config.ts\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\nERROR(vue-tsc) Argument of type '{ $fetch: $Fetch\u003Cunknown, NitroFetchRequest>; headers: Headers; onRequest: (FetchHook\u003CFetchContext\u003Cany, ResponseType>> | globalThis.Ref\u003C...> | ComputedOptions\u003C...> | undefined)[]; ... 38 more ...; method: \"CONNECT\" | \"DELETE\" | \"GET\" | \"HEAD\" | \"OPTIONS\" | \"PATCH\" | \"POST\" | \"PUT\" | \"TRACE\"; }' is not assignable to parameter of type 'Omit\u003COmit\u003CRequestOptions\u003CComposable, unknown, unknown, string>, \"method\"> & Pick\u003CRequired\u003CRequestOptions\u003CComposable, unknown, unknown, string>>, \"method\">, \"composable\">'.\n Types of property 'key' are incompatible.\n Type 'string | Ref\u003Cstring, string> | ComputedRef\u003Cstring> | (() => string) | undefined' is not assignable to type 'string | undefined'.\n Type 'Ref\u003Cstring, string>' is not assignable to type 'string'.\n FILE /home/projects/wmaiozakro.github/types/openapi/client/client.ts:106:29\n\n 104 |\n 105 | if (composable === '$fetch') {\n > 106 | return executeFetchFn(opts, fetchFn);\n | ^^^^\n 107 | }\n 108 |\n 109 | if (composable === 'useFetch' || composable === 'useLazyFetch') {\n\n ERROR(vue-tsc) Argument of type '{ $fetch: $Fetch\u003Cunknown, NitroFetchRequest>; headers: Headers; onRequest: (FetchHook\u003CFetchContext\u003Cany, ResponseType>> | globalThis.Ref\u003C...> | ComputedOptions\u003C...> | undefined)[]; ... 38 more ...; method: \"CONNECT\" | \"DELETE\" | \"GET\" | \"HEAD\" | \"OPTIONS\" | \"PATCH\" | \"POST\" | \"PUT\" | \"TRACE\"; }' is not assignable to parameter of type 'Omit\u003COmit\u003CRequestOptions\u003CComposable, unknown, unknown, string>, \"method\"> & Pick\u003CRequired\u003CRequestOptions\u003CComposable, unknown, unknown, string>>, \"method\">, \"composable\">'.\n Types of property 'key' are incompatible.\n Type 'string | Ref\u003Cstring, string> | ComputedRef\u003Cstring> | (() => string) | undefined' is not assignable to type 'string | undefined'.\n Type 'Ref\u003Cstring, string>' is not assignable to type 'string'.\n FILE /home/projects/wmaiozakro.github/types/openapi/client/client.ts:124:47\n\n 122 | }\n 123 |\n > 124 | const handler: any = () => executeFetchFn(opts, fetchFn);\n | ^^^^\n 125 |\n 126 | if (composable === 'useAsyncData') {\n 127 | return key\n\n[vue-tsc] Found 2 errors. Watching for file changes.\n```",[3102],{"name":3024,"color":3025},32477,"Nux: client.ts typescript error","2025-06-25T17:43:36Z","https://github.com/nuxt/nuxt/issues/32477",0.6700392,{"description":3109,"labels":3110,"number":3113,"owner":3027,"repository":3027,"state":3062,"title":3114,"updated_at":3115,"url":3116,"score":3117},"### Environment\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.8.2\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: pnpm@8.7.1\r\n- Builder: -\r\n- User Config: modules, runtimeConfig, css, site, linkChecker, devtools\r\n- Runtime Modules: @nuxt/ui@2.11.1, @nuxtseo/module@2.0.0-beta.50\r\n- Build Modules: -\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\n```ts\r\nconst config = useRuntimeConfig()\r\nconst { data: followers } = await useFetch('/repos', {\r\n baseUrl: config.public.apiBase,\r\n})\r\n```\r\n\r\ninside a script tag. In your nuxt.config.ts file, you must define a apiBase.\r\n\r\n```\r\n runtimeConfig: {\r\n public: {\r\n apiBase: 'http://localhost:3333',\r\n },\r\n },\r\n```\r\n\r\n### Describe the bug\r\n\r\nThis will give you the following type error\r\n\r\n```\r\nNo overload matches this call.\r\n Overload 1 of 2, '(request: \"/repos\" | Ref\u003C\"/repos\"> | (() => \"/repos\"), opts?: UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, null, \"/repos\", \"get\"> | undefined): AsyncData\u003Cunknown, FetchError\u003Cany> | null>', gave the following error.\r\n Overload 2 of 2, '(request: \"/repos\" | Ref\u003C\"/repos\"> | (() => \"/repos\"), opts?: UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, unknown, \"/repos\", \"get\"> | undefined): AsyncData\u003Cunknown, FetchError\u003Cany> | null>', gave the following error.\r\n```\r\n\r\n\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\nusing `npx nuxi typecheck`\r\n\r\n```\r\npages/index.vue:4:3 - error TS2769: No overload matches this call.\r\n Overload 1 of 2, '(request: \"/repos\" | Ref\u003C\"/repos\"> | (() => \"/repos\"), opts?: UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, null, \"/repos\", \"get\"> | undefined): AsyncData\u003Cunknown, FetchError\u003Cany> | null>', gave the following error.\r\n Object literal may only specify known properties, but 'baseUrl' does not exist in type 'UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, null, \"/repos\", \"get\">'. Did you mean to write 'baseURL'?\r\n Overload 2 of 2, '(request: \"/repos\" | Ref\u003C\"/repos\"> | (() => \"/repos\"), opts?: UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, unknown, \"/repos\", \"get\"> | undefined): AsyncData\u003Cunknown, FetchError\u003Cany> | null>', gave the following error.\r\n Object literal may only specify known properties, but 'baseUrl' does not exist in type 'UseFetchOptions\u003Cunknown, unknown, KeysOf\u003Cunknown>, unknown, \"/repos\", \"get\">'. Did you mean to write 'baseURL'?\r\n\r\n4 baseUrl: config.public.apiBase,\r\n ~~~~~~~\r\n\r\n\r\n\r\nFound 1 error in pages/index.vue:4\r\n\r\n\r\n ERROR Command failed with exit code 2: npx -p vue-tsc -p typescript vue-tsc --noEmit 10:42:22 AM\r\n\r\n at makeError (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/chunks/index3.mjs:625:11)\r\n at handlePromise (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/chunks/index3.mjs:1821:26)\r\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at async Object.run (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/chunks/typecheck.mjs:82:7)\r\n at async runCommand$1 (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)\r\n at async runCommand$1 (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)\r\n at async runMain$1 (node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7) \r\n\r\n\r\n\r\n ERROR Command failed with exit code 2: npx -p vue-tsc -p typescript vue-tsc --noEmit \r\n```\r\n",[3111,3112],{"name":3081,"color":3082},{"name":3024,"color":3025},24791,"Type issue when using `useFetch` with baseURL","2023-12-16T09:44:02Z","https://github.com/nuxt/nuxt/issues/24791",0.67151064,{"description":3119,"labels":3120,"number":3122,"owner":3027,"repository":3027,"state":3062,"title":3123,"updated_at":3124,"url":3125,"score":3126},"### Environment\n\n------------------------------\n- Operating System: Darwin\n- Node Version: v20.15.1\n- Nuxt Version: 3.14.1592\n- CLI Version: 3.15.0\n- Nitro Version: 2.10.4\n- Package Manager: npm@10.9.0\n- Builder: -\n- User Config: default\n- Runtime Modules: -\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://github.com/mklnz/nuxt-custom-usefetch\n\n### Describe the bug\n\nBlank reproducible example at: https://github.com/mklnz/nuxt-custom-usefetch\n\nI'm following the example at:\nhttps://nuxt.com/docs/guide/recipes/custom-usefetch\n\nI'm getting a Typescript error when generics are added, error below:\n\nThe error goes away when generics are removed, e.g.:\n```typescript\nexport function useAPI\u003CT>(\n url: string | (() => string),\n options?: UseFetchOptions\u003CT>,\n) {\n return useFetch(url, {\n ...options,\n $fetch: useNuxtApp().$api as typeof $fetch\n })\n}\n```\n\n\n```\n[{\n\t\"resource\": \"/Users/Bob/Development/my-site/composables/useAPI.ts\",\n\t\"owner\": \"typescript\",\n\t\"code\": \"2769\",\n\t\"severity\": 8,\n\t\"message\": \"No overload matches this call.\\n Overload 1 of 2, '(request: NitroFetchRequest | Ref\u003CNitroFetchRequest, NitroFetchRequest> | (() => NitroFetchRequest), opts?: UseFetchOptions\u003C...> | undefined): AsyncData\u003C...>', gave the following error.\\n Argument of type '{ $fetch: typeof $fetch; key?: string; watch?: MultiWatchSources | false; default?: (() => globalThis.Ref\u003Cnull, null> | null) | undefined; ... 38 more ...; onResponseError?: FetchHook\u003C...> | ... 3 more ... | undefined; }' is not assignable to parameter of type 'UseFetchOptions\u003CT extends void ? unknown : T, T extends void ? unknown : T, KeysOf\u003CT extends void ? unknown : T>, null, NitroFetchRequest, T extends void ? \\\"get\\\" : AvailableRouterMethod\u003C...>>'.\\n Types of property 'getCachedData' are incompatible.\\n Type '((key: string, nuxtApp: NuxtApp) => NoInfer\u003CT> | undefined) | undefined' is not assignable to type '((key: string, nuxtApp: NuxtApp) => NoInfer\u003CT extends void ? unknown : T> | undefined) | undefined'.\\n Type '(key: string, nuxtApp: NuxtApp) => NoInfer\u003CT> | undefined' is not assignable to type '(key: string, nuxtApp: NuxtApp) => NoInfer\u003CT extends void ? unknown : T> | undefined'.\\n Type 'NoInfer\u003CT> | undefined' is not assignable to type 'NoInfer\u003CT extends void ? unknown : T> | undefined'.\\n Type 'NoInfer\u003CT>' is not assignable to type 'NoInfer\u003CT extends void ? unknown : T> | undefined'.\\n Type 'T' is not assignable to type 'NoInfer\u003CT extends void ? unknown : T> | undefined'.\\n Overload 2 of 2, '(request: NitroFetchRequest | Ref\u003CNitroFetchRequest, NitroFetchRequest> | (() => NitroFetchRequest), opts?: UseFetchOptions\u003C...> | undefined): AsyncData\u003C...>', gave the following error.\\n Argument of type '{ $fetch: typeof $fetch; key?: string; watch?: MultiWatchSources | false; default?: (() => globalThis.Ref\u003Cnull, null> | null) | undefined; ... 38 more ...; onResponseError?: FetchHook\u003C...> | ... 3 more ... | undefined; }' is not assignable to parameter of type 'UseFetchOptions\u003CT extends void ? unknown : T, T extends void ? unknown : T, KeysOf\u003CT extends void ? unknown : T>, T extends void ? unknown : T, NitroFetchRequest, T extends void ? \\\"get\\\" : AvailableRouterMethod\u003C...>>'.\\n Types of property 'default' are incompatible.\\n Type '(() => Ref\u003Cnull, null> | null) | undefined' is not assignable to type '(() => (T extends void ? unknown : T) | Ref\u003CT extends void ? unknown : T, T extends void ? unknown : T>) | undefined'.\\n Type '() => Ref\u003Cnull, null> | null' is not assignable to type '() => (T extends void ? unknown : T) | Ref\u003CT extends void ? unknown : T, T extends void ? unknown : T>'.\\n Type 'Ref\u003Cnull, null> | null' is not assignable to type '(T extends void ? unknown : T) | Ref\u003CT extends void ? unknown : T, T extends void ? unknown : T>'.\\n Type 'null' is not assignable to type '(T extends void ? unknown : T) | Ref\u003CT extends void ? unknown : T, T extends void ? unknown : T>'.\",\n\t\"source\": \"ts\",\n\t\"startLineNumber\": 13,\n\t\"startColumn\": 52,\n\t\"endLineNumber\": 16,\n\t\"endColumn\": 4\n}]\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3121],{"name":3024,"color":3025},30013,"Typescript error when following custom useFetch example","2024-12-16T23:15:48Z","https://github.com/nuxt/nuxt/issues/30013",0.6715587,{"description":3128,"labels":3129,"number":3132,"owner":3027,"repository":3027,"state":3062,"title":3133,"updated_at":3134,"url":3135,"score":3136},"\u003C!-- 💚 Thanks for your time to make Nuxt better with your feedbacks 💚\r\n\r\n**IMPORTANT** Before reporting a bug:\r\n\r\n- Please make sure that you have read through Nuxt documentation: https://nuxtjs.org\r\n- If issue is related to a module please create the issue in corresponding repository\r\n- Ensure using latest version of nuxt dependencies using `yarn upgrade nuxt` or `npm upgrade nuxt`\r\n\r\n👍 A properly detailed bug report can save a LOT of time and help fixing issues as soon as possible.\r\n-->\r\n\r\n### Versions\r\n\r\n- nuxt: 3.0.0-rc.12 & 3.0.0-rc.13\r\n- node: v16.11.0\r\n\r\n### Reproduction\r\nhttps://stackblitz.com/edit/github-itsfns?file=app.vue\r\n\r\nWorks fine (`asyncData` is a `_AsyncData\u003C{ title: string }, true | FetchError\u003Cany> | null>`:\r\n```ts\r\nconst customApi = async () => {\r\n\tconst asyncData = await useFetch\u003C{ title: string }>('https://api.nuxtjs.dev/mountains', {\r\n\t\tpick: ['title'],\r\n\t\tmethod: 'GET',\r\n\t});\r\n\treturn asyncData;\r\n};\r\nconst result = await customApi();\r\nconsole.log(result.data.value?.title);\r\n```\r\nNot working (`asyncData` is a `_AsyncData\u003CPickFrom\u003C_ResT, KeyOfRes\u003CTransform>>, true | FetchError\u003Cany> | null>`):\r\n```ts\r\nconst customApi = async \u003CT>() => {\r\n\tconst asyncData = await useFetch\u003CT>('https://api.nuxtjs.dev/mountains', {\r\n\t\tpick: ['title'],\r\n\t\tmethod: 'GET',\r\n\t});\r\n\treturn asyncData;\r\n};\r\nconst result = await customApi\u003C{ title: string }>();\r\nconsole.log(result.data.value?.title);\r\n```\r\n\r\nAdditionally, setting the `pick1 field causes an error.\r\n\r\n\u003Cdetails open>\r\n\u003Csummary>Additional Details\u003C/summary>\r\n\u003Cbr>\r\nI would like to add that everything worked very well before. Unfortunately, now even undoing the Nuxt version doesn't help.\r\n\u003C/details>\r\n\r\n### Steps to reproduce\r\nCopy and paste code above.\r\n\r\n### What is Expected?\r\nI want to create a custom `useFetch` and be able to type a response ([link1](https://stackoverflow.com/questions/72041740/how-to-set-global-api-baseurl-used-in-usefetch-in-nuxt-3), [link2](https://github.com/nuxt/nuxt.js/issues/12885))\r\n\r\n### What is actually happening?\r\nI am getting a weird type causing my application to fail.\r\n",[3130,3131],{"name":3081,"color":3082},{"name":3024,"color":3025},15401,"Generic response type not working with `useFetch`","2023-01-22T15:48:41Z","https://github.com/nuxt/nuxt/issues/15401",0.6727215,["Reactive",3138],{},["Set"],["ShallowReactive",3141],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f7bgeRCA1owA8zNLpALbCdIxl-QLjNA8yAICgWAIePcg":-1},"/nuxt/nuxt/9853"]