\r\n```\r\nMy `index.ts` is as below.\r\n\r\n```typescript\r\nimport { useFoo } from '~shared/foo'\r\n\r\nconst foo = useFoo;\r\n```\r\n\r\nI am getting below error.\r\n\r\n```\r\n[plugin:vite:import-analysis] Failed to resolve import \"~shared/foo\" from \"pages\\index.ts?macro=true\". Does the file exist?\r\nC:/Projects/GitLab/legal-disco-typescript/web-ui/pages/index.ts:1:0\r\n1 | import { useFoo } from \"~shared/foo\";\r\n | ^\r\n2 | const foo = useFoo;\r\n3 |\r\n at formatError (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:40862:46)\r\n at TransformContext.error (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:40858:19)\r\n at normalizeUrl (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:37595:33)\r\n at runMicrotasks (\u003Canonymous>)\r\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\r\n at async TransformContext.transform (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:37728:47)\r\n at async Object.transform (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:41111:30)\r\n at async loadAndTransform (file:///C:/Projects/GitLab/my-project-typescript/web-ui/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:37373:29\r\nClick outside or fix the code to dismiss.\r\nYou can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.\r\n```\n\n### Describe the bug\n\nFile import out of nuxt project not working even after setting paths in tsconfig.json\n\n### Additional context\n\nHave raised issue on stackoverflow as well.\r\nhttps://stackoverflow.com/questions/74244503/nuxt-3-tsconfig-path-is-not-working-from-parent-directory\n\n### Logs\n\n_No response_",[3234,3235],{"name":3162,"color":3163},{"name":3146,"color":3147},15302,"import out of nuxt project is not working even after setting paths in tsconfig.json","2023-01-19T17:47:37Z","https://github.com/nuxt/nuxt/issues/15302",0.6678998,{"labels":3242,"number":3245,"owner":3152,"repository":3152,"state":3166,"title":3246,"updated_at":3247,"url":3248,"score":3249},[3243,3244],{"name":3162,"color":3163},{"name":3146,"color":3147},26731,"ERROR Failed to resolve import \"#internal/nuxt/paths\" from \"virtual:nuxt:C:\\Users\\MyPc\\Workspace\\myproject\\apps\\myapp\\.nuxt\\fetch.mjs\". Does the file exist? ","2024-04-25T08:23:41Z","https://github.com/nuxt/nuxt/issues/26731",0.67270225,{"description":3251,"labels":3252,"number":3254,"owner":3152,"repository":3152,"state":3166,"title":3255,"updated_at":3256,"url":3257,"score":3258},"### Environment\n\n- Operating System: Linux\n- Node Version: v22.13.0\n- Nuxt Version: 4.1.0\n- CLI Version: 3.28.0\n- Nitro Version: 2.12.5\n- Package Manager: npm@11.3.0\n- Builder: -\n- User Config: compatibilityDate, devtools, typescript\n- Runtime Modules: -\n- Build Modules: -\n\n\n### Reproduction\nhttps://codesandbox.io/p/sandbox/sharp-feistel-shs7xc\n\nSteps:\n\n1. Create a Nuxt 3 project.\n2. Add a component at `app/components/TestComponent.vue`.\n3. Run `npm run dev` to generate `.nuxt/types/components.d.ts`.\n4. Inspect the generated file — the import looks like:\n\n```ts\ntypeof import(\"../app/components/TestComponent.vue\")['default']\n```\n\nBut since `components.d.ts` is inside `.nuxt/types/`, the correct path should be:\n```ts\ntypeof import(\"../../app/components/TestComponent.vue\")['default']\n```\n\nI also noticed I have 2 `components.d.ts` - one within `types/` and other present directly under `.nuxt/`. Webstorm's go-to-definition redirects me to `.nuxt/types/components.d.ts` where the paths should have another `../`.\n\n### Describe the bug\n\nNuxt currently generates `components.d.ts` imports relative to buildDir (e.g. `.nuxt/`).\n\nHowever, the file actually resides in `.nuxt/types/`, which is one directory deeper.\n\nAs a result, all generated import paths are off by one `../`.\n\nThis breaks IDE features:\n1. \"Go to definition\" in WebStorm jumps to invalid paths takes me to `components.d.ts` but then I cannot repeat it to get to the actual file.\n2. Autocomplete for props and attributes does not work correctly.\n3. IDE shows no type errors for missing required props (only runtime/terminal warnings like [Vue warn]: Missing required prop: \"title\").\n\nThis issue is similar to the existing discussion [#16270](https://github.com/nuxt/nuxt/discussions/16270), where VSCode’s Ctrl+Click opens .nuxt/components.d.ts instead of the actual component file. The suggested workaround was using the vscode-goto-alias extension. \nIs there any Jetbrains/Webstorm equivalent?\n\nI’m not sure if the current behavior is intended for tooling reasons or I've configured the project in an incorrect way.\n\n### Additional context\n\nThe issue is in `resolveComponentTypes` (`packages/nuxt/src/components/templates.ts`), where it uses: `relative(buildDir, c.filePath)`.\n\n\nI tried change this locally to: `relative(join(buildDir, \"types\"), c.filePath)` and then everything works as intended.\n\n\n### Logs\n\n```shell-script\nWARN [Vue warn]: Missing required prop: \"title\" at \u003CTestComponent> 1:50:20 PM\nat \u003CIndex>\nat \u003CRouteProvider>\nat \u003CRouterView>\nat \u003CNuxtPage>\nat \u003CApp>\nat \u003CNuxtRoot>\n\n\nThese warning do not show up in the IDE.\n```",[3253],{"name":3146,"color":3147},33143,"Incorrect relative imports in `.nuxt/types/components.d.ts` cause broken IDE navigation and missing autocomplete","2025-09-05T10:02:56Z","https://github.com/nuxt/nuxt/issues/33143",0.67353445,["Reactive",3260],{},["Set"],["ShallowReactive",3263],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f_bMJZR7Qu2JOuKdeZnd83SyApct1R8LuqjHbvi6BF4s":-1},"/nuxt/nuxt/22228"]