\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_",[2000,2001],{"name":1985,"color":1986},{"name":1988,"color":1989},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.66600466,{"labels":2008,"number":2016,"owner":1991,"repository":1991,"state":1992,"title":2017,"updated_at":2018,"url":2019,"score":2020},[2009,2010,2013],{"name":1985,"color":1986},{"name":2011,"color":2012},"bug","d73a4a",{"name":2014,"color":2015},"🔨 p3-minor","FBCA04",14461,"False error thrown if page hierarchy contains file or folder with the name \"nuxt.config\"","2023-01-19T17:35:45Z","https://github.com/nuxt/nuxt/issues/14461",0.66724914,{"description":2022,"labels":2023,"number":2033,"owner":1991,"repository":1991,"state":1992,"title":2034,"updated_at":2035,"url":2036,"score":2037},"in my situation,I prebuild nuxt app with CI tools like Jenkins\r\n\r\nresult:\r\n\r\n```\r\n//.nuxt/router.js\r\nconst _24c434bb = () => import('/foo/bar/pages/xxx.vue' )\r\n```\r\nthen, my build task would transport all files to production environment, which directory structure is different with build env, so my app can not run correctly\r\n\r\nwhat i expected is relative path\r\n```\r\n//.nuxt/router.js\r\nconst _24c434bb = () => import('../pages/xxx.vue' )\r\n```\r\n\r\ninfluenced files: \r\n\r\n- components/nuxt.vue\r\n- App.vue\r\n- index.js\r\n- router.js\r\n\r\n\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This feature request is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c715\">#c715\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2024,2027,2030],{"name":2025,"color":2026},"enhancement","8DEF37",{"name":2028,"color":2029},"available soon","6de8b0",{"name":2031,"color":2032},"2.x","d4c5f9",828,"template import modules use absolute path","2023-01-18T15:39:48Z","https://github.com/nuxt/nuxt/issues/828",0.6677663,{"description":2039,"labels":2040,"number":2033,"owner":1991,"repository":2045,"state":1992,"title":2046,"updated_at":2047,"url":2048,"score":2037},"### Environment\n\n- Operating System: `Darwin`\r\n- Node Version: `v20.11.0`\r\n- Nuxt Version: `3.11.2`\r\n- CLI Version: `3.11.1`\r\n- Nitro Version: `2.9.6`\r\n- Package Manager: `pnpm@8.14.2`\r\n- Builder: `-`\r\n- User Config: `devtools`, `modules`, `pinia`, `typescript`\r\n- Runtime Modules: `@nuxt/test-utils/module@3.12.1`, `@pinia/nuxt@0.5.1`\r\n- Build Modules: `-`\n\n### Reproduction\n\nhttps://github.com/lucasecdb/nuxt-app-pinia-repro\r\n\r\nInstall dependencies with `pnpm install` then run `pnpm test`\n\n### Describe the bug\n\nIf you configure a vue plugin using Nuxt plugins, like the following:\r\n\r\n```ts\r\n// plugins/pinia.ts\r\nimport { createPinia } from 'pinia';\r\n\r\nexport default defineNuxtPlugin((nuxtApp) => {\r\n nuxtApp.vueApp.use(createPinia())\r\n})\r\n```\r\n\r\nGiven the following component and Pinia store:\r\n\r\n```vue\r\n\u003Ctemplate>\r\n \u003Cp>{{ date }}\u003C/p>\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\nconst store = useMyStore();\r\n\r\nconst date = computed(() => store.date);\r\n\u003C/script>\r\n```\r\n\r\n```ts\r\n// stores/my-store.ts\r\nexport const useMyStore = defineStore('my-store', () => {\r\n return {\r\n date: ref(new Date()),\r\n };\r\n});\r\n```\r\n\r\nAnd then try to overwrite that plugin during testing:\r\n\r\n```ts\r\n// __tests__/my-component.test.ts\r\nimport { createPinia } from 'pinia';\r\n\r\nit('should pass', async () => {\r\n await renderSuspended(MyComponent, {\r\n global: { plugins: [createPinia()] },\r\n });\r\n\r\n // ...\r\n});\r\n```\r\n\r\nThe instance returned by `useMyStore` will always use the Pinia store supplied by `plugins/pinia`, and not from the `global.plugins` parameter provided to `renderSuspended`.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2041,2042],{"name":2011,"color":2012},{"name":2043,"color":2044},"vitest-environment","b60205","test-utils","Plugins not overwritten when passed as options","2024-05-07T12:10:27Z","https://github.com/nuxt/test-utils/issues/828",{"description":2050,"labels":2051,"number":2056,"owner":1991,"repository":1991,"state":1992,"title":2057,"updated_at":2058,"url":2059,"score":2060},"### Environment\n\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v21.2.0\r\n- Nuxt Version: 3.9.0\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: yarn@1.22.21\r\n- Builder: -\r\n- User Config: devtools, components\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nimport an external component library on app.vue in the nuxt scaffold app and get error:\r\n`[vite-node] [ERR_LOAD_URL] @someOrg/someLib/index.js` \n\n### Describe the bug\n\nWhen using an external organization scoped package it fails to resolve the path at build time with error:\r\n```\r\nERROR Pre-transform error: Failed to resolve import \"@someOrg/someLib/index.js\" from \"app.vue\". Does the file exist?\r\n```\r\nI've tried removing the scope locally and the import works after, i.e. `import { AppButton } from \"someOrg/someLib/index.js\"\";`\r\n\r\nThis happens after upgrading to version 3.9.0, and was not happening with version 3.8.2\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2052,2053,2054],{"name":1985,"color":1986},{"name":1988,"color":1989},{"name":2055,"color":2015},"needs reproduction",25055,"[nuxt 3.9] build failed when importing components from npm package","2024-01-05T20:36:38Z","https://github.com/nuxt/nuxt/issues/25055",0.66838163,{"description":2062,"labels":2063,"number":2066,"owner":1991,"repository":1991,"state":1992,"title":2067,"updated_at":2068,"url":2069,"score":2070},"### Environment\r\n\r\nENV\r\nos: Darwin\r\nnodejs: 20.9.0\r\nnuxt: 3.8.1\r\n@nuxt/test-utils: 3.8.1\r\nvitest: 1.1.1\r\nyarn: 1.15.2\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/nuxt-starter-rx4vx2?file=package.json,testUtils.js,testUtils.test.js\r\n\r\nyou can run test command below.\r\n```\r\nnpm test\r\n``` \r\n\r\n### Describe the bug\r\n\r\nHello, I am using Vitest for testing on Nuxt3, vite env.\r\nDue to our team's convention, the configuration uses 'autoImport: false'.(For an explicit declaration) So when importing Nuxt's built-in items (useRoute, nextTick, computed, etc.) we use import '#imports'.\r\n\r\nWhen I run Vitest, the following error occurs:\r\n\r\nError: Failed to resolve import \"#imports\" from \"[file path]\". Does the file exist?\r\nHow do I solve this? help.\r\nIs this something that needs to be fixed in vitest?\r\n(I registered an issue on vitest. https://github.com/vitest-dev/vitest/issues/4853)\r\n(https://github.com/nuxt/nuxt/discussions/24719)\r\n\r\nBelow is my vitest.config.js\r\n```javascript\r\nimport path from 'path';\r\nimport vue from '@vitejs/plugin-vue';\r\n\r\nexport default {\r\n plugins: [vue()],\r\n test: {\r\n globals: true,\r\n environment: 'jsdom'\r\n },\r\n resolve: {\r\n alias: {\r\n '@': path.resolve(__dirname, './src')\r\n }\r\n }\r\n};\r\n``` \r\n\r\nThanks.\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2064,2065],{"name":1985,"color":1986},{"name":1988,"color":1989},25021,"Vitest can't resolve import '#imports'(Nuxt3, vitest)","2024-06-21T04:50:44Z","https://github.com/nuxt/nuxt/issues/25021",0.6699839,{"description":2072,"labels":2073,"number":2075,"owner":1991,"repository":1991,"state":1992,"title":2076,"updated_at":2077,"url":2078,"score":2079},"### Environment\r\n\r\n```\r\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v20.14.0\r\n- Nuxt Version: 4.0.0-28696289.ed54884c\r\n- CLI Version: 3.13.0-1719571044.bca75ab\r\n- Nitro Version: -\r\n- Package Manager: pnpm@9.4.0\r\n- Builder: -\r\n- User Config: compatibilityDate, devtools\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n------------------------------\r\n```\r\n\r\n### Reproduction\r\n\r\n> For details, check the parent issue: https://github.com/nuxt/devtools/issues/698\r\n\r\n**Reproducible repository:** https://github.com/pan93412/nuxt-4-devtools-regression\r\n\r\n**Steps:**\r\n\r\n1. Clone the repository\r\n2. `pnpm install && pnpm dev`\r\n3. Open the page in Chrome or Firefox, the DevTools cannot show up.\r\n\r\n### Describe the bug\r\n\r\n> Check this parent issue for details: https://github.com/nuxt/devtools/issues/698#issuecomment-2244969473\r\n\r\nAfter the final investigation, I can conclude this bug is a due to the circular import.\r\n\r\n`#app/config` contains this import [^1]:\r\n\r\n```ts\r\nimport { reactive } from 'vue'\r\nimport { klona } from 'klona'\r\nimport type { AppConfig } from 'nuxt/schema'\r\nimport { useNuxtApp } from './nuxt'\r\n// @ts-expect-error virtual file\r\nimport __appConfig from '#build/app.config.mjs' // oops\r\n```\r\n\r\n`#build/app.config.mjs` is basically the content I mentioned above [^2]:\r\n\r\n```js\r\nimport { defuFn } from 'defu'\r\n\r\nconst inlineConfig = ${JSON.stringify(nuxt.options.appConfig, null, 2)}\r\n\r\n/** client **/\r\n// Vite - webpack is handled directly in #app/config\r\nif (import.meta.dev && !import.meta.nitro && import.meta.hot) {\r\n const { updateAppConfig } = await import('#app/config') // oops\r\n import.meta.hot.accept((newModule) => {\r\n updateAppConfig(newModule.default)\r\n })\r\n}\r\n/** client-end **/\r\n```\r\n\r\n[^1]: \r\n[^2]: \r\n\r\n\r\n### Additional context\r\n\r\nMy original fix idea[^1] does not seem like a good approach. It runs `import('#app/config')` regardless of whether we are in a development environment or not. Instead of refactoring the entire module, the best idea would be to add a counter to prevent circular imports.\r\n\r\n[^1]: I can open a PR to revert the await import('#app/config') to import { updateAppConfig } from '#app/config'. [src](https://github.com/nuxt/devtools/issues/698#issuecomment-2244969473)\r\n\r\n\r\n### Logs\r\n\r\n_No response_",[2074],{"name":1988,"color":1989},28348,"Circular import in #app/config makes some plugins failed to load","2024-08-05T16:19:17Z","https://github.com/nuxt/nuxt/issues/28348",0.67121494,{"labels":2081,"number":2084,"owner":1991,"repository":1991,"state":1992,"title":2085,"updated_at":2086,"url":2087,"score":2088},[2082,2083],{"name":1985,"color":1986},{"name":1988,"color":1989},13059,"incorrect importing path of es module with @ in path in production mode","2023-01-19T16:42:42Z","https://github.com/nuxt/nuxt/issues/13059",0.67194706,{"labels":2090,"number":2093,"owner":1991,"repository":1991,"state":1992,"title":2094,"updated_at":2095,"url":2096,"score":2097},[2091,2092],{"name":1985,"color":1986},{"name":2011,"color":2012},12089,"No match found for location with path \"/__webpack_hmr/client\"","2023-01-19T15:55:06Z","https://github.com/nuxt/nuxt/issues/12089",0.6727255,["Reactive",2099],{},["Set"],["ShallowReactive",2102],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"_bMJZR7Qu2JOuKdeZnd83SyApct1R8LuqjHbvi6BF4s":-1},"/nuxt/nuxt/22228"]