\n\n### Workaround\nUsing `defineVitestConfig` and hoisting the configuration up to root works fine. Unfortunately I'd need to run three Vitest tasks and couldn't make use of the `projects` functionality.\n\nFor example:\n\n```\npnpm vitest --config vitest.browser.config.ts\npnpm vitest --config vitest.unit.config.ts\npnpm vitest --config vitest.e2e.config.ts\n# 😔\n```\n\n---\n\nSo, I can't figure out how to get it working. I've tried different combinations, singular projects, and using the deprecated `workspaces` key. The method `defineVitestProject` isn't documented and I've read through the code and I'm not really sure why I'm getting an error.\n\n### Nuxt Info\n\n```\n- Operating System: `Darwin`\n- Node Version: `v22.14.0`\n- Nuxt Version: `3.17.5`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `pnpm@10.11.1`\n- Builder: `-`\n- User Config: `compatibilityDate`, `modules`\n- Runtime Modules: `@nuxt/test-utils/module@3.19.1`\n- Build Modules: `-`\n```\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [x] Read the [contribution guide](https://nuxt.com/docs/community/contribution).\n- [x] Check existing [discussions](https://github.com/nuxt/nuxt/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[3134],{"name":3135,"color":3136},"pending triage","5D08F5",1322,"nuxt","test-utils","open","Support Vitest `projects` option for Browser Mode","2025-06-18T13:51:03Z","https://github.com/nuxt/test-utils/issues/1322",0.65046674,{"description":3146,"labels":3147,"number":3160,"owner":3138,"repository":3138,"state":3140,"title":3161,"updated_at":3162,"url":3163,"score":3164},"### Environment\r\n\r\n- Operating System: `Darwin`\r\n- Node Version: `v18.4.0`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `npm@8.12.1`\r\n- Builder: `vite`\r\n- User Config: `-`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\n### Minimum Reproduction\r\nhttps://github.com/kazupon/nuxt-kit-resolvepath-repro\r\n\r\n### Steps to reproduce\r\n\r\n```sh\r\nnpm install\r\nnpx jiti repro.ts\r\n```\r\n\r\n\r\n### Describe the bug\r\n\r\nWhen I do the above reproduction steps, I get the following output in my environment:\r\n\r\n```\r\nvue-i18n path with resolvePath: /path/to/repro/nuxt-kit-resolvepath-repro/node_modules/vue-i18n/dist/vue-i18n.mjs\r\n@intlify/vue-i18n-bridge path with resolvePath: /path/to/repro/nuxt-kit-resolvepath-repro/@intlify/vue-i18n-bridge\r\n@intlify/vue-router-bridge path with resolvePath: /path/to/repro/nuxt-kit-resolvepath-repro/@intlify/vue-router-bridge\r\nvue-i18n-routing path with resolvePath: /path/to/repro/nuxt-kit-resolvepath-repro/vue-i18n-routing\r\n```\r\n\r\n`@nuxtjs/i18n` depends on `vue-i18n-routing`. And `vue-i18n-routing` further more depends on `@intlify/vue-i18n-bridge` and `@intlify/vue-router-bridge`.\r\nWhen I try to resolve those modules with `resolvePath`, it seems that node_modules installed with the version of npm in this environment do not resolve correctly.\r\n\r\nHere is the @nuxtjs/i18n package structure:\r\n\u003Cimg width=\"328\" alt=\"image\" src=\"https://user-images.githubusercontent.com/72989/205476877-538e8fef-d86a-4866-8288-9e68ff03e7d1.png\">\r\n\r\n\r\n### Additional context\r\n\r\n### Different behavior for different versions of npm\r\nThe version of npm used in stackblitz nuxt starter kit is v7.x.\r\nThis version of npm seems to resolve correctly with `resolvePath`.\r\n\r\nHere is stackblitz repro \r\nhttps://stackblitz.com/edit/nuxt-starter-3jdhcy\r\n\r\nWhen we do `npx jiti repro.ts` in the above stackblitz environment will output the following:\r\n\r\n```\r\n~/projects/nuxt-starter-3jdhcy\r\n❯ npx jiti repro.ts\r\nvue-i18n path with resolvePath: /home/projects/nuxt-starter-3jdhcy/node_modules/vue-i18n/dist/vue-i18n.mjs\r\n@intlify/vue-i18n-bridge path with resolvePath: /home/projects/nuxt-starter-3jdhcy/node_modules/@intlify/vue-i18n-bridge/lib/index.cjs\r\n@intlify/vue-router-bridge path with resolvePath: /home/projects/nuxt-starter-3jdhcy/node_modules/@intlify/vue-router-bridge/lib/index.cjs\r\nvue-i18n-routing path with resolvePath: /home/projects/nuxt-starter-3jdhcy/node_modules/vue-i18n-routing/index.mjs\r\n```\r\n\r\nThe package structure is as follows:\r\n```\r\n~/projects/nuxt-starter-3jdhcy\r\n❯ ls node_modules/@nuxtjs/i18n/\r\nLICENSE README.md dist/ package.json \r\n```\r\n\r\n```\r\n❯ npm -v\r\n7.17.0\r\n```\r\n\r\nIt is v7.x in Stackbliz environment. I have tried npm v9 and the issue reproduces as well.\r\n(I know npm hoist algorithm is complicated and weird ...😅)\r\n\r\n### related issue\r\nI found out about the issue in the following issue of @nuxtjs/i18n.\r\nhttps://github.com/nuxt-modules/i18n/issues/1683\r\n\r\nI'll work around this issue with this module itself.\r\n\r\n\r\n### Logs\r\n\r\n_No response_",[3148,3151,3154,3157],{"name":3149,"color":3150},"bug","d73a4a",{"name":3152,"color":3153},"kit","60E14C",{"name":3155,"color":3156},"🔨 p3-minor","FBCA04",{"name":3158,"color":3159},"✨ good reproduction","fbca04",15721,"cannot resolve module path correctly with `resolvePath` on un-hoisted structure pacakges?","2024-11-19T16:20:22Z","https://github.com/nuxt/nuxt/issues/15721",0.6647842,{"description":3166,"labels":3167,"number":3169,"owner":3138,"repository":3138,"state":3170,"title":3171,"updated_at":3172,"url":3173,"score":3174},"### Environment\n\nWorking directory: /home/tofandel/PhpstormProjects/nuxt-server/packages/web \n\n------------------------------\n- Operating System: Linux\n- Node Version: v22.12.0\n- Nuxt Version: 3.17.4\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@11.3.0\n- Builder: -\n- User Config: devtools, future, typescript, compatibilityDate, telemetry, runtimeConfig, router, routeRules, vue, vite, i18n, features, app, appConfig, imports, css, image, modules, nitro, pwa\n- Runtime Modules: @nuxt/test-utils/module@3.19.1\n- Build Modules: -\n------------------------------\n\n\n### Reproduction\n\n```js\nexport default defineNuxtConfig({\n modules: [\n '@nuxt/test-utils/module'\n ]\n})\n```\nhttps://stackblitz.com/edit/github-u65dcxgy?file=.nuxt%2Ftsconfig.json\n\nThen run nuxt prepare and check the `.nuxt/tsconfig.json` file\n\n### Describe the bug\n\nWhile looking at the generated tsconfig I noticed a very weird include entry, caused by the follwing module `@nuxt/test-utils/module`\n\n```json\n{ \"include\": [\n \"../../../../../../Phpstor/runtime\",\n \"../../../../../../Phpstor/dist/runtime\",\n] }\n```\n\nA quick debug into `resolveNuxtModule` with `@nuxt/test-utils/module` explained why\nhttps://github.com/nuxt/nuxt/blob/726ac60e2f07c6fc9d1ecd708ab84d50462b01e1/packages/kit/src/resolve.ts#L103-L114\n```js\nconst resolvedPath = await resolver.resolvePath(path);\nconsole.log(path) // @nuxt/test-utils/module\nconsole.log(resolvedPath) // /home/tofandel/PhpstormProjects/nuxt-server/node_modules/@nuxt/test-utils/dist/module.mjs \nresolved.push(resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length)); // /home/tofandel/Phpstor\n```\n\nBasically there is no check if resolvedPath.lastIndexOf will return -1 because resolvedPath doesn't contain the path leading to a garbarged path out\n",[3168],{"name":3155,"color":3156},32225,"closed","resolveNuxtModule fails for some modules","2025-07-28T16:24:46Z","https://github.com/nuxt/nuxt/issues/32225",0.62559885,{"description":3176,"labels":3177,"number":3180,"owner":3138,"repository":3138,"state":3170,"title":3181,"updated_at":3182,"url":3183,"score":3184},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v20.19.1\n- Nuxt Version: 4.0.1\n- CLI Version: 3.27.0\n- Nitro Version: 2.12.3\n- Package Manager: pnpm@8.15.6\n- Builder: -\n- User Config: compatibilityDate, modules\n- Runtime Modules: @nuxt/test-utils/module@3.19.2\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-ptl9ccci\n\n### Describe the bug\n\n`nuxt.config.ts`:\n```\nexport default defineNuxtConfig({\n compatibilityDate: '2025-07-15',\n modules: [\"@nuxt/test-utils/module\"],\n})\n```\n\nparts of `.nuxt/tsconfig.app.json`:\n```\n{\n ...\n \"include\": [\n ...\n \"../layers/*/*.d.ts\",\n \"../runtime\", // this line\n \"../dist/runtime\" // this line\n ],\n \"exclude\": [\n ...\n \"../layers/*/modules/**/*\",\n \"../runtime/server\", // this line\n \"../dist/runtime/server\", // this line\n \"../*.*\", // this line\n \"../node_modules/.pnpm/.../node_modules/@nuxt/devtools/runtime/server\",\n ...\n ]\n```\n\n### Additional context\n\nIt seems to be caused by [`resolveNuxtModule` from @nuxt/kit.](https://github.com/nuxt/nuxt/blob/c2c18e7e53fb03c1e60bc0fc4182741b3d473a1a/packages/kit/src/resolve.ts#L112)\n\nI tried:\n```\nasync function resolveNuxtModule(base, paths) {\n const resolved = [];\n const resolver = createResolver(base);\n for (const path of paths) {\n if (path.startsWith(base)) {\n resolved.push(path.split(\"/index.ts\")[0]);\n } else {\n const resolvedPath = await resolver.resolvePath(path);\n console.log(`path: ${path}`);\n console.log(` Resolved path: ${resolvedPath}`);\n console.log(` resolvedPath.lastIndexOf(path): ${resolvedPath.lastIndexOf(path)}`);\n console.log(` resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length): ${resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length)}`);\n resolved.push(resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length));\n }\n }\n return resolved;\n}\n```\n\nand logs:\n```\npath: @nuxt/test-utils/module 오전 11:25:28\n Resolved path: C:/WorkSpace/web-next/node_modules/.pnpm/@nuxt+test-utils@3.19.2_magicast@0.3.5_typescript@5.8.3/node_modules/@nuxt/test-utils/dist/module.mjs 오전 11:25:28\n resolvedPath.lastIndexOf(path): -1 오전 11:25:28 \n resolvedPath.slice(0, resolvedPath.lastIndexOf(path) + path.length): C:/WorkSpace/web-next/ 오전 11:25:28 \n...\n```\n\nThis probably works fine in most scenarios — I just happened to hit the unlucky case.\n\n### Logs\n\n```shell-script\n\n```",[3178],{"name":3135,"color":3179},"E99695",32782,"If a module is not exported from the index, an incorrect path will be included in the tsconfig file","2025-07-28T11:05:44Z","https://github.com/nuxt/nuxt/issues/32782",0.63213694,{"description":3186,"labels":3187,"number":3189,"owner":3138,"repository":3138,"state":3170,"title":3190,"updated_at":3191,"url":3192,"score":3193},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v20.19.1\n- Nuxt Version: 4.0.0\n- CLI Version: 3.26.2\n- Nitro Version: 2.12.0\n- Package Manager: pnpm@8.15.6\n- Builder: -\n- User Config: compatibilityDate, devtools, modules\n- Runtime Modules: @nuxt/test-utils/module@3.19.2\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\n- Install `@nuxt/test-utils`\n- Add '@nuxt/test-utils/module' to your `modules` in nuxt.config.ts\n- Check the \"include\" and \"exclude\" sections of the different tsconfig files in the `.nuxt` folder\n- In the stackblitz repro the buggy folder is `\"../../owailgn/*.*\"`\n\nhttps://stackblitz.com/edit/github-uihhqgzu?file=.nuxt%2Ftsconfig.node.json\n\n\n### Describe the bug\n\nIf a module is installed whose module name is not part of the install path on the filesystem (in `node_modules`), wrong entries are added to the `tsconfig*.json` files in the `.nuxt` folder. Instead of the path to the module the resolver adds a path outside of the project folder, e.g. `\"../../../../../Document/*.*\"`.\n\nI think I have narrowed this down to `resolveNuxtModule`. In there if `resolvedPath.lastIndexOf(path)` cannot find a match the string pushed to `resolved` is broken/cutoff.\nhttps://github.com/nuxt/nuxt/blob/9193b324701106fec71878f4a267f03bb7e5b1eb/packages/kit/src/resolve.ts#L103-L117\n\nThis is the e.g. case for the nuxt test-utils which are added via '@nuxt/test-utils/module', but in the node_modules folder the path is just '@nuxt/test-utils/dist/...' resulting in no match for `lastIndexOf`.\n\nI am not 100% sure if this is a bug in nuxt or nuxt-test-utils but I think nuxt should at least skip entries which cannot be resolved correctly.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3188],{"name":3135,"color":3179},32681,"`tsconfig`: Folders outside of project are added if module name does not match filesystem path","2025-07-18T20:21:38Z","https://github.com/nuxt/nuxt/issues/32681",0.6324209,{"labels":3195,"number":3202,"owner":3138,"repository":3138,"state":3170,"title":3203,"updated_at":3204,"url":3205,"score":3206},[3196,3199],{"name":3197,"color":3198},"question","cc317c",{"name":3200,"color":3201},"3.x","29bc7f",13728,"Module not accept typescript path alias","2024-02-25T18:03:19Z","https://github.com/nuxt/nuxt/issues/13728",0.64272726,{"description":3208,"labels":3209,"number":3211,"owner":3138,"repository":3138,"state":3170,"title":3212,"updated_at":3213,"url":3214,"score":3215},"### Environment\n\n- Operating System: Linux\n- Node Version: v20.9.0\n- Nuxt Version: 3.16.0\n- CLI Version: 3.22.5\n- Nitro Version: 2.11.5\n- Package Manager: yarn@1.22.19\n- Builder: -\n- User Config: compatibilityDate, devtools, alias\n- Runtime Modules: -\n- Build Modules: -\n\n\n### Reproduction\n\nhttps://codesandbox.io/p/sandbox/intelligent-cartwright-7gf5kh\n\n### Describe the bug\n\nExample alias\n\n```typescript\nimport { fileURLToPath } from 'url';\n\nexport default defineNuxtConfig({\n // ...\n alias: {\n '#external': fileURLToPath(new URL('./external', import.meta.url)),\n },\n});\n```\n\n`.nuxt/tsconfig.json`\n\n```\n\"compilerOptions\": {\n \"paths\": {\n ...\n \"#external\": [\n \"../external\"\n ],\n \"#external/*\": [\n \"../external/*\"\n ],\n ...\n```\n\n`.nuxt/tsconfig.server.json`\n\n```\n\"compilerOptions\": {\n \"paths\": {\n ... 👈 #external path not generated\n```\n\nHowever, `#external/*` resolvable in both dev mode and build.\n\n### Additional context\n\n⚠️ Current workaround:\n\n```typescript\nimport { fileURLToPath } from 'url';\n\nexport default defineNuxtConfig({\n // ...\n\n alias: {\n '#external': fileURLToPath(new URL('./external', import.meta.url)),\n },\n\n nitro: {\n typescript: {\n tsConfig: {\n compilerOptions: {\n // 👇 manually adds path\n paths: {\n \"#external\": [\n fileURLToPath(new URL(\"./external\", import.meta.url)),\n ],\n \"#external/*\": [\n fileURLToPath(new URL(\"./external\", import.meta.url)) + \"/*\",\n ],\n }\n }\n }\n },\n }\n});\n```\n\n### Logs\n\n```shell-script\n\n```",[3210],{"name":3135,"color":3179},31325,"Nuxt 3.16.0 alias not generated in `tsconfig.server.json`","2025-03-11T08:32:37Z","https://github.com/nuxt/nuxt/issues/31325",0.65503824,{"labels":3217,"number":3222,"owner":3138,"repository":3138,"state":3170,"title":3223,"updated_at":3224,"url":3225,"score":3226},[3218,3221],{"name":3219,"color":3220},"documentation","5319e7",{"name":3200,"color":3201},13357,"Inconsistent alias documentation","2023-01-19T16:53:05Z","https://github.com/nuxt/nuxt/issues/13357",0.65661323,{"description":3228,"labels":3229,"number":3233,"owner":3138,"repository":3139,"state":3170,"title":3234,"updated_at":3235,"url":3236,"score":3237},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.12.0`\n- Nuxt Version: `3.17.3`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `bun@1.2.14`\n- Builder: `-`\n- User Config: `modules`, `typescript`, `alias`, `compatibilityDate`, `css`, `devtools`, `experimental`, `future`, `rootDir`, `vite`, `hanko`, `i18n`\n- Runtime Modules: `~~/modules/startup-check`, `@nuxt/fonts@0.11.4`, `@nuxt/icon@1.13.0`, `@nuxt/image@1.10.0`, `@nuxt/test-utils@3.19.0`, `@nuxt/test-utils/module@3.19.0`, `@nuxt/ui@3.1.2`, `@nuxtjs/i18n@9.5.4`, `@nuxtjs/hanko@1.0.0`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-d5xpujkj?file=test%2Fbug.test.ts\n\n### Describe the bug\n\nI got some trouble when I updated from 3.18 to 3.19\n\nAfter the update only `.nuxt.test.ts` tests are run by vitest.\n\nTo restore the previous behaviour (also running tests unrelated to nuxt), I now need to set environment \"nuxt\", which feels really unintiutive.\n```TypeScript\nexport default defineVitestConfig({\n test: {\n environment: \"nuxt\",\n },\n})\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3230],{"name":3231,"color":3232},"good first issue","7057ff",1296,"Update from 3.18 to 3.19 changed default configuration, causing tests without .nuxt. to not be included","2025-06-20T07:54:57Z","https://github.com/nuxt/test-utils/issues/1296",0.66336,{"description":3239,"labels":3240,"number":3243,"owner":3138,"repository":3138,"state":3170,"title":3244,"updated_at":3245,"url":3246,"score":3247},"### Environment\n\n- Operating System: Windows_NT\r\n- Node Version: v21.6.1\r\n- Nuxt Version: 3.9.3\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: yarn@1.22.19\r\n- Builder: -\r\n- User Config: -\r\n- Runtime Modules: -\r\n- Build Modules: -\n\n### Reproduction\n\nhttps://github.com/TutorFx/nuxt-zod/tree/type-bug-reproduction\n\n### Describe the bug\n\nAfter creating the module using npx nuxi init -t module _project name_, I noticed that some typings were missing.\r\n\r\n```ts\r\nimport MyModule from '../../../src/module'\r\n\r\nexport default defineNuxtConfig({\r\n// ^^^^^^^^^^^^^^^\r\n// Cannot find name 'defineNuxtConfig'. Did you mean 'defineNitroConfig'?ts(2552)\r\n// nitro.da3b833a.d.ts(867, 11): 'defineNitroConfig' is declared here.\r\n modules: [\r\n MyModule\r\n ]\r\n})\r\n\r\n```\r\n```ts\r\nimport { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit'\r\n\r\n// Module options TypeScript interface definition\r\nexport interface ModuleOptions {}\r\n\r\nexport default defineNuxtModule\u003CModuleOptions>({\r\n meta: {\r\n name: 'my-module',\r\n configKey: 'myModule'\r\n },\r\n // Default configuration options of the Nuxt module\r\n defaults: {},\r\n setup (options, nuxt) {\r\n const resolver = createResolver(import.meta.url)\r\n// ^^^^^^^^^^\r\n// The 'import.meta' meta-property is only allowed when the '--module'\r\n// option is 'es2020', 'es2022', 'esnext', 'system', 'node16', \r\n// or 'nodenext'.ts(1343)\r\n\r\n // Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`\r\n addPlugin(resolver.resolve('./runtime/plugin'))\r\n }\r\n})\r\n```\n\n### Additional context\n\nSome things I tried to work around the problem:\r\n\r\n- npm ci\r\n- enable the \"Takeover\" mode\r\n- delete the node_modules\r\n- update the node to v21.6.1\r\n\n\n### Logs\n\n_No response_",[3241,3242],{"name":3200,"color":3201},{"name":3135,"color":3179},25456,"Nuxt's module \"defineNuxtConfig\" type error","2024-01-28T23:50:06Z","https://github.com/nuxt/nuxt/issues/25456",0.66405064,["Reactive",3249],{},["Set"],["ShallowReactive",3252],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fIMnGubZ9wkIU4ZqQIx0Q6hBd6OxM3Xtcgo01KqoyR5o":-1},"/nuxt/test-utils/1408"]