",[3172],{"name":3173,"color":3174},"pending triage","E99695",32714,"nuxt","open","fix(types): v4 auto-import in shared directory","2025-07-21T23:23:54Z","https://github.com/nuxt/nuxt/issues/32714",0.61249256,{"description":3183,"labels":3184,"number":3186,"owner":3176,"repository":3176,"state":3177,"title":3187,"updated_at":3188,"url":3189,"score":3190},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.14.0`\n- Nuxt Version: `4.1.1`\n- CLI Version: `3.28.0`\n- Nitro Version: `2.12.5`\n- Package Manager: `npm@10.9.2`\n- Builder: `-`\n- User Config: `devtools`, `features`, `app`, `modules`, `storyblok`, `robots`, `i18n`, `pinia`, `site`, `sitemap`, `linkChecker`, `ogImage`, `image`, `fonts`, `googleFonts`, `runtimeConfig`, `vite`, `alias`, `css`, `hooks`, `gtag`, `viewport`, `extends`, `imports`, `booster`, `vitalizer`, `experimental`, `sourcemap`, `compatibilityDate`\n- Runtime Modules: `@nuxtjs/i18n@9.5.6`, `@nuxt/image@1.11.0`, `@nuxtjs/seo@3.1.0`, `@nuxt/scripts@0.11.13`, `@pinia/nuxt@0.11.2`, `@nuxtjs/google-fonts@3.2.0`, `@storyblok/nuxt@8.0.8`, `@nuxt/fonts@0.11.4`, `nuxt-viewport@2.3.1`, `nuxt-gtag@4.0.0`, `nuxt-booster@3.3.0`, `nuxt-seo-utils@7.0.14`, `nuxt-vitalizer@0.10.0`, `cja-phoenix@1.2.1`\n- Build Modules: `-`\n\n### Reproduction\n\n[Reproduction with local module and custom module installed](https://codesandbox.io/p/devbox/heuristic-lamport-h8yn44)\n\n### Describe the bug\n\nWhen I add a directory containing type exports using `addImportsDir` inside the custom module `cja-phoenix`, those exports are then not added to the `imports.d.ts` inside the user project's `.nuxt` directory when installed. It seems that types specifically are being ignored somehow, a class and an array inside said directory are not ignored.\n\nAll the .ts files are being correctly transformed into .d.ts files and seem to be correct inside the dist file after module installation, they're simply not referred in the `imports.d.ts` in the user project.\n\nAuto imports for local modules work correctly however, only when a package is installed do the types not get detected.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3185],{"name":3173,"color":3174},33195,"addImportsDir types are not added to auto imports in user project","2025-09-10T13:01:34Z","https://github.com/nuxt/nuxt/issues/33195",0.6347824,{"description":3192,"labels":3193,"number":3198,"owner":3176,"repository":3176,"state":3199,"title":3200,"updated_at":3201,"url":3202,"score":3203},"### Environment\n\nWorking directory: /project/workspace nuxi 1:52:42 PM\nNuxt project info: nuxi 1:52:42 PM\n\n------------------------------\n- Operating System: Linux\n- Node Version: v20.12.1\n- Nuxt Version: 4.1.0\n- CLI Version: 3.28.0\n- Nitro Version: 2.12.4\n- Package Manager: pnpm@8.15.6\n- Builder: -\n- User Config: compatibilityDate, devtools\n- Runtime Modules: -\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://codesandbox.io/p/sandbox/nameless-cache-csywmk\n\n\u003Cimg width=\"814\" height=\"250\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/df8bfc8a-b5d7-42ae-af75-ec5b0f6da306\" />\n\n### Describe the bug\n\nIt seems that the types of auto imported components get lost.\n\n### Additional context\n\nI can't reproduce that in nuxt 3 projects.\n\n### Logs\n\n```shell-script\n\n```",[3194,3195],{"name":3173,"color":3174},{"name":3196,"color":3197},"possible regression","B90A42",33138,"closed","Types not working with auto imported Components","2025-09-04T20:27:47Z","https://github.com/nuxt/nuxt/issues/33138",0.59755415,{"description":3205,"labels":3206,"number":3209,"owner":3176,"repository":3176,"state":3199,"title":3210,"updated_at":3211,"url":3212,"score":3213},"### Environment\n\n```\nWorking directory: /app nuxi 9:14:31 PM\nNuxt project info: nuxi 9:14:31 PM\n\n------------------------------\n- Operating System: Linux\n- Node Version: v22.15.0\n- Nuxt Version: 4.0.3\n- CLI Version: 3.27.0\n- Nitro Version: 2.12.4\n- Package Manager: npm@10.9.2\n- Builder: -\n- User Config: app, compatibilityDate, devtools, modules, devServer, runtimeConfig, vite\n- Runtime Modules: @nuxt/eslint@1.5.2, @nuxt/test-utils/module@3.19.2\n- Build Modules: -\n------------------------------\n\n👉 Report an issue: https://github.com/nuxt/nuxt/issues/new?template=bug-report.yml\n👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new\n👉 Read documentation: https://nuxt.com\n```\n\n### Reproduction\n\nReproduced with a simple Nuxt config, shown below.\n\n### Describe the bug\n\nIn Nuxt v3, it was possible to auto-import from a `types` folder using something like the following:\n\n```\nimport { defineNuxtConfig } from 'nuxt/config'\n\n// https://nuxt.com/docs/api/configuration/nuxt-config\nexport default defineNuxtConfig({\n compatibilityDate: '2024-11-01',\n imports: {\n dirs: [\n 'types/*.ts',\n ],\n },\n})\n```\n\nIn this case, the types declared in `types/*.ts` would automatically get added to `src/.nuxt/imports.d.ts`, and then auto-imported in components and such. After upgrading to v4, this fails: the types in `types/*.ts` are no longer added to `imports.d.ts`.\n\nOne solution, mentioned in the Discord server ([here](https://discord.com/channels/473401852243869706/1401602660838412348)) is to add types in `shared/types`. That's an okay solution, but it's not documented anywhere, and the Discord bot gave the typical AI-generated wrong answer (use `declare global`...).\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3207,3208],{"name":3173,"color":3174},{"name":3196,"color":3197},32870,"Auto-import types from \"types\" directory breaks when upgrading from v3 to v4","2025-08-06T11:25:54Z","https://github.com/nuxt/nuxt/issues/32870",0.59824514,{"labels":3215,"number":3228,"owner":3176,"repository":3176,"state":3199,"title":3229,"updated_at":3230,"url":3231,"score":3232},[3216,3219,3222,3225],{"name":3217,"color":3218},"types","2875C3",{"name":3220,"color":3221},"3.x","29bc7f",{"name":3223,"color":3224},"bug","d73a4a",{"name":3226,"color":3227},"🔨 p3-minor","FBCA04",13713,"`#imports` types don't include server auto-imports","2023-03-13T16:54:30Z","https://github.com/nuxt/nuxt/issues/13713",0.62387305,{"description":3234,"labels":3235,"number":3242,"owner":3176,"repository":3176,"state":3199,"title":3243,"updated_at":3244,"url":3245,"score":3246},"### Environment\n\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v20.15.1\r\n- Nuxt Version: 3.13.0\r\n- CLI Version: 3.13.1\r\n- Nitro Version: 2.9.7\r\n- Package Manager: bun@1.1.27\r\n- Builder: -\r\n- User Config: compatibilityDate, devtools\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-hxerk6?file=app.tsx\n\n### Describe the bug\n\nComponents types are not being auto imported when working with `tsx` files instead `vue`. (But they render ok)\r\nFor example I get: `Cannot find name 'NuxtLink'.`\r\nBut if I import the `NuxtLink` from `#components` manually I get the typings.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3236,3237,3238,3239],{"name":3217,"color":3218},{"name":3223,"color":3224},{"name":3226,"color":3227},{"name":3240,"color":3241},"✨ good reproduction","fbca04",28781,"(tsx) Auto imports typings","2024-09-02T11:02:48Z","https://github.com/nuxt/nuxt/issues/28781",0.62580174,{"description":3248,"labels":3249,"number":3253,"owner":3176,"repository":3176,"state":3199,"title":3254,"updated_at":3255,"url":3256,"score":3257},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.20.5\n- Nuxt Version: 3.14.159\n- CLI Version: 3.15.0\n- Nitro Version: 2.10.4\n- Package Manager: bun@1.1.34\n- Builder: -\n- User Config: default\n- Runtime Modules: -\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nWhen defining `shared/types/test.ts` with:\n```ts\nexport type Test = string;\n```\nI have, from `app.vue`:\n\nAnd if I press `\u003Ctab>`, vscode inserts:\n```ts\nimport type { Test } from '~~/shared/types/test';\n```\nWhich defeats the point of autoimports.\n\n### Describe the bug\n\nAlso the behavior is not always the same, sometimes (although not often) I see the alias instead and it doesn't insert the extra line.\n\nWhat's wrong?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3250,3251],{"name":3173,"color":3174},{"name":3252,"color":3227},"needs reproduction",29963,"Shared folder - Autoimports not working","2025-03-24T23:00:22Z","https://github.com/nuxt/nuxt/issues/29963",0.6267815,{"description":3259,"labels":3260,"number":3264,"owner":3176,"repository":3176,"state":3199,"title":3265,"updated_at":3266,"url":3267,"score":3268},"### Environment\n\n------------------------------\r\n- Operating System: `Windows_NT`\r\n- Node Version: `v16.16.0`\r\n- Nuxt Version: `3.2.3`\r\n- Nitro Version: `2.2.3`\r\n- Package Manager: `npm@9.4.0`\r\n- Builder: `vite`\r\n- User Config: `alias`, `app`, `build`, `imports`, `modules`, `naiveUI`, `ssr`, `supabase`, `runtimeConfig`, `tailwindcss`, `typescript`\r\n- Runtime Modules: `@vueuse/nuxt@9.13.0`, `@nuxtjs/tailwindcss@6.4.1`, `@pinia/nuxt@0.4.7`, `@nuxtjs/critters@0.4.0`, `@nuxtjs/fontaine@0.2.4`, `@nuxtjs/google-fonts@3.0.0-1`, `@nuxt/image-edge@1.0.0-27954023.4cee565`, `nuxt-headlessui@1.1.1`, `@nuxtjs/supabase@0.3.1`, `@formkit/nuxt@1.0.0-beta.15`, `@huntersofbook/naive-ui-nuxt@0.7.1` \r\n- Build Modules: `-`\n\n### Reproduction\n\nI am sorry to open this without a reproduction, but I simply cannot reproduce this. It happens in a specific repo, and I have tried thousands of things, though cannot find what causes the issue. \r\n\r\nI am opening this issue so that people can weigh in and if there are others experiencing this, they can use the hack I've found (see below).\n\n### Describe the bug\n\nAuto import of my components work great. But their types are not recognized in VS Code. Whenever I hover over a component in the `\u003Ctemplate>` section of an SFC, its type is indicated as `any`. \r\n\r\nIt is very weird but I've found a hack: When I reference the `.nuxt/components` path anywhere in the project, the types start working. So I added this line to my `app.vue` file:\r\n\r\n```\r\nimport {} from \".nuxt/components\";\r\n``` \r\n\r\nI think something is causing Nuxt to ignore the `.nuxt/components` path but when I reference it somewhere, Nuxt starts recognizing it back.\r\n\r\nI'd be forever grateful if someone knows what is going on here and suggest where to look.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3261,3262,3263],{"name":3220,"color":3221},{"name":3173,"color":3174},{"name":3252,"color":3227},19427,"Auto imported component types do not work","2023-03-08T08:40:06Z","https://github.com/nuxt/nuxt/issues/19427",0.6283076,{"description":3270,"labels":3271,"number":3279,"owner":3176,"repository":3176,"state":3199,"title":3280,"updated_at":3281,"url":3282,"score":3283},"### Environment\n\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v20.5.1\r\n- Nuxt Version: 3.7.0\r\n- CLI Version: 3.7.3\r\n- Nitro Version: 2.6.2\r\n- Package Manager: pnpm@8.7.1\r\n- Builder: -\r\n- User Config: modules, auth, security, typescript, devtools, i18n, postcss, tailwindcss, vue, vite\r\n- Runtime Modules: nuxt-security@0.14.4, @sidebase/nuxt-auth@0.5.0, @nuxtjs/tailwindcss@6.8.0, nuxt-svgo@3.5.0, @vueuse/nuxt@10.4.1, @nuxtjs/i18n@8.0.0-rc.4\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-xodh6t?file=modules%2Fexample%2Fpages%2Fsomething%2Findex.vue\n\n### Describe the bug\n\nThere are missing types from auto-imports, and that the ref, $fetch, or other variables are being inferred as `any` in modules.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3272,3274,3275,3276,3277,3278],{"name":3273,"color":3241},"good first issue",{"name":3217,"color":3218},{"name":3220,"color":3221},{"name":3223,"color":3224},{"name":3226,"color":3227},{"name":3240,"color":3241},22988,"Incorrect types of auto-imports in modules","2023-09-22T07:25:54Z","https://github.com/nuxt/nuxt/issues/22988",0.63088405,{"description":3285,"labels":3286,"number":3289,"owner":3176,"repository":3176,"state":3199,"title":3290,"updated_at":3291,"url":3292,"score":3293},"### Environment\n\n- Operating System: Darwin\n- Node Version: v22.14.0\n- Nuxt Version: 4.0.0\n- CLI Version: 3.26.2\n- Nitro Version: 2.12.0\n- Package Manager: pnpm@10.13.1\n- Builder: -\n- User Config: -\n- Runtime Modules: -\n- Build Modules: -\n\n### Reproduction\n\nDirectly happening in the Nuxt repo, instance on https://github.com/nuxt/nuxt/blob/main/test/fixtures/basic-types/nuxt.schema.ts\n\n### Describe the bug\n\nTypescript should resolves the auto imported function.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3287,3288],{"name":3217,"color":3218},{"name":3226,"color":3227},32642,"[v4] `defineNuxtSchema` isn’t resolved by TypeScript","2025-07-17T14:09:06Z","https://github.com/nuxt/nuxt/issues/32642",0.63179386,["Reactive",3295],{},["Set"],["ShallowReactive",3298],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f7LDwONcBptAwhaiJ1-n23eWyHXS9PNPZ9dRI3pN4hvY":-1},"/nuxt/test-utils/1432"]