\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).",[3032],{"name":3019,"color":3020},1322,"Support Vitest `projects` option for Browser Mode","2025-06-18T13:51:03Z","https://github.com/nuxt/test-utils/issues/1322",0.63350815,{"description":3039,"labels":3040,"number":3043,"owner":3022,"repository":3022,"state":3024,"title":3044,"updated_at":3045,"url":3046,"score":3047},"### Environment\n\nWorking directory: /home/olada/nuxt-starter-ebey3puz nuxi 00:02:27\nNuxt project info: nuxi 00:02:27\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.20.3\n- Nuxt Version: 3.16.1\n- CLI Version: 3.23.1\n- Nitro Version: 2.11.7\n- Package Manager: npm@10.2.3\n- Builder: -\n- User Config: compatibilityDate, devtools, pages, modules\n- Runtime Modules: @nuxt/test-utils/module@3.17.2\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/~/github.com/olada/nuxt-starter-ebey3puz\n\nRun `pnpm test` (automatically run when opening the reproduction)\n\n### Describe the bug\n\nI have attempted to write a test for a plugin I have written.\n\nI was surprised to find that vitest shows an error message that no test suite can be found\n\n```\n❯ plugins/customFetch.nuxt.spec.ts (0 test)\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\n\n FAIL plugins/customFetch.nuxt.spec.ts [ plugins/customFetch.nuxt.spec.ts ]\nError: No test suite found in file /home/olada/nuxt-starter-ebey3puz/plugins/customFetch.nuxt.spec.ts\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯\n\n\n Test Files 1 failed (1)\n Tests no tests\n Start at 00:01:38\n Duration 506ms\n\n FAIL Tests failed. Watching for file changes...\n press h to show help, press q to quit\nCancelling test run. Press CTRL+c again to exit forcefully.\n\n ELIFECYCLE Test failed. See above for more details.\n```\n\nWhen renaming the folder \"plugins\" to e.g. \"pluginss\" or when moving the file /plugins/customFetch.spec.ts to /plugins/__tests__/customFetch.spec.ts the tests are correctly picked up.\n\nIt seems that nuxt somehow interferes with the test strategy of placing the tests into the very same directory as the \"live code\".\n\nAs a side note: Nuxt detects the spec file as a plugin and renders a warning that no default export was found inside of the .spec. file. \n```\n[warn] [nuxt] Plugin `/home/olada/nuxt-starter-ebey3puz/plugins/customFetch.nuxt.spec.ts` has no default export and will be ignored at build time. Add `export default defineNuxtPlugin(() => {})` to your plugin.\n```\n\nMaybe the fact that Nuxt interpretes spec-files as a real plugin is related to the whole \"no test suite found\" issue?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\nRERUN plugins/customFetch.nuxt.spec.ts x1 \n\n[warn] [nuxt] Plugin `/home/olada/nuxt-starter-ebey3puz/plugins/customFetch.nuxt.spec.ts` has no default export and will be ignored at build time. Add `export default defineNuxtPlugin(() => {})` to your plugin.\n ❯ plugins/customFetch.nuxt.spec.ts (0 test)\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\n\n FAIL plugins/customFetch.nuxt.spec.ts [ plugins/customFetch.nuxt.spec.ts ]\nError: No test suite found in file /home/olada/nuxt-starter-ebey3puz/plugins/customFetch.nuxt.spec.ts\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯\n\n\n Test Files 1 failed (1)\n Tests no tests\n Start at 00:01:38\n Duration 506ms\n\n FAIL Tests failed. Watching for file changes...\n press h to show help, press q to quit\nCancelling test run. Press CTRL+c again to exit forcefully.\n\n ELIFECYCLE Test failed. See above for more details.\n\n~/olada/nuxt-starter-ebey3puz main 5m 37s\n❯ npx nuxi info\nWorking directory: /home/olada/nuxt-starter-ebey3puz nuxi 00:02:09\nNuxt project info: nuxi 00:02:09\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.20.3\n- Nuxt Version: 3.16.1\n- CLI Version: 3.23.1\n- Nitro Version: 2.11.7\n- Package Manager: npm@10.2.3\n- Builder: -\n- User Config: compatibilityDate, devtools, pages, modules\n- Runtime Modules: @nuxt/test-utils/module@3.17.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~/olada/nuxt-starter-ebey3puz main 2s\n❯ pnpx nuxi info\nPackages: +1\n+\nProgress: resolved 1, reused 0, downloaded 1, added 1, done\nWorking directory: /home/olada/nuxt-starter-ebey3puz nuxi 00:02:27\nNuxt project info: nuxi 00:02:27\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.20.3\n- Nuxt Version: 3.16.1\n- CLI Version: 3.23.1\n- Nitro Version: 2.11.7\n- Package Manager: npm@10.2.3\n- Builder: -\n- User Config: compatibilityDate, devtools, pages, modules\n- Runtime Modules: @nuxt/test-utils/module@3.17.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```",[3041],{"name":3019,"color":3042},"E99695",31515,"No test suite found inside of \"plugins\" folder","2025-03-24T07:54:01Z","https://github.com/nuxt/nuxt/issues/31515",0.64722294,{"description":3049,"labels":3050,"number":3052,"owner":3022,"repository":3023,"state":3024,"title":3053,"updated_at":3054,"url":3055,"score":3056},"### Environment\n\n- Operating System: `Windows_NT`\n- Node Version: `v22.16.0`\n- Nuxt Version: `3.17.5`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `npm@10.9.2`\n- Builder: `-`\n- User Config: `runtimeConfig`, `ssr`, `alias`, `compatibilityDate`, `devtools`, `css`, `vite`, `modules`\n- Runtime Modules: `@nuxt/test-utils/module@3.19.1`\n- Build Modules: `-`\n\n### Reproduction\n\n```json\n//package.json\n{\n \"name\": \"dummy-repo\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest\",\n },\n \"dependencies\": {\n \"nuxt\": \"^3.17.5\",\n \"vue\": \"^3.5.16\",\n },\n \"devDependencies\": {\n \"@nuxt/test-utils\": \"^3.19.1\",\n \"happy-dom\": \"^17.6.3\",\n \"vitest\": \"^3.2.3\"\n }\n}\n```\n\n```ts\n//nuxt.config.ts\nexport default defineNuxtConfig({\n ...\n modules: [\n '@nuxt/test-utils/module'\n ]\n})\n```\n\n```ts\n//vitest.config.ts\nimport { configDefaults } from 'vitest/config';\nimport { defineVitestConfig } from '@nuxt/test-utils/config';\nimport vue from '@vitejs/plugin-vue';\n\nexport default defineVitestConfig({\n test: {\n ...\n projects: [\n ...\n {\n plugins: [vue()],\n test: {\n environmentOptions: {\n // nuxt: { // purposely commented out\n // url: 'http://localhost:3000',\n // other properties...\n // }\n },\n include: [\n 'tests/app.test.ts', //With dummy app.vue it can be empty template\n ],\n name: 'Nuxt Environment',\n globals: true,\n environment: 'nuxt',\n },\n },\n ],\n },\n})\n``\n\n### Describe the bug\n\n```bash\n# run\nnpm run test\n```\nResults in:\n\n```bash\nTypeError: Cannot read properties of undefined (reading 'url') # checking this\n ❯ Object.setup node_modules/@nuxt/test-utils/dist/vitest-environment.mjs:177:31\n ❯ withEnv node_modules/vitest/dist/chunks/runBaseTests.Dd85QTll.js:82:32\n ❯ run node_modules/vitest/dist/chunks/runBaseTests.Dd85QTll.js:109:8\n ❯ runBaseTests node_modules/vitest/dist/chunks/base.Cg0miDlQ.js:32:2\n ❯ ForksBaseWorker.executeTests node_modules/vitest/dist/workers/forks.js:29:4\n ❯ execute node_modules/vitest/dist/worker.js:108:3\n ❯ onMessage node_modules/tinypool/dist/entry/process.js:39:18\n```\n\nIn line `Object.setup node_modules/@nuxt/test-utils/dist/vitest-environment.mjs:177:31` seeing this `environmentOptions?.nuxt.url ?? \"http://localhost:3000\",`\n\nI believe `nuxt` could use the help of question mark, so that `http://localhost:3000` can be reached.\n\nSo change the line to `environmentOptions?.nuxt?.url ?? \"http://localhost:3000\",`\n\n### Note on Documention\n\nI see one of the guys constantly saying \"Just follow the documentation\"\nThe documentation specifically says, it can be added [OPTIONALLY](https://nuxt.com/docs/getting-started/testing#using-a-nuxt-runtime-environment)\n```\nexport default defineVitestConfig({\n test: {\n environment: 'nuxt',\n // you can optionally set Nuxt-specific environment options\n // environmentOptions: {\n // nuxt: {\n // rootDir: fileURLToPath(new URL('./playground', import.meta.url)),\n // domEnvironment: 'happy-dom', // 'happy-dom' (default) or 'jsdom'\n // overrides: {\n // // other Nuxt config you want to pass\n // }\n // }\n // }\n }\n})\n```\nThe source code currently makes us doing that mandatorily.\n\nSame thing with the next line.\n\n`environmentOptions?.nuxtRuntimeConfig.app?.baseURL || \"/\"`\n\n```bash\nTypeError: Cannot read properties of undefined (reading 'app')\n```\n\nLet me know, what I can add as a work around, because the documentation doesn't even have anything on the optional side.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3051],{"name":3019,"color":3020},1326,"Cannot read url of undefined","2025-06-16T10:23:27Z","https://github.com/nuxt/test-utils/issues/1326",0.6575909,{"description":3058,"labels":3059,"number":3067,"owner":3022,"repository":3022,"state":3068,"title":3069,"updated_at":3070,"url":3071,"score":3072},"### Environment\n\n```\r\n- Operating System: `Darwin`\r\n- Node Version: `v16.16.0`\r\n- Nuxt Version: `3.0.0-rc.11`\r\n- Nitro Version: `0.5.4`\r\n- Package Manager: `yarn@1.22.11`\r\n- Builder: `vite`\r\n```\r\n\r\nThough I have also tested with rc 10, 8, 5, & 4\n\n### Reproduction\n\nThis is fairly short so ill avoid reproduction unless theres a strong need\r\n\r\nFrom a fresh Nuxt 3 Project:\r\n\r\n```json\r\n// package.json\r\n\r\n{\r\n \"scripts\": {\r\n ...\r\n \"build\": \"nuxt build\",\r\n \"test\": \"vitest run\"\r\n },\r\n \"devDependencies\": {\r\n \"nuxt\": \"3.0.0-rc.11\"\r\n },\r\n \"dependencies\": {\r\n \"@nuxt/test-utils\": \"3.0.0-rc.11\",\r\n \"vitest\": \"^0.23.4\"\r\n }\r\n}\r\n```\r\n\r\n```ts\r\n// vite.config.ts\r\n\r\nimport { defineConfig } from \"vitest/config\";\r\n\r\nexport default defineConfig({\r\n test: {\r\n globals: true,\r\n },\r\n});\r\n```\r\n\r\n```html\r\n// pages/index.vue\r\n\r\n\u003Ctemplate>\r\n \u003Ch1>Hello World!\u003C/h1>\r\n\u003C/template>\r\n```\r\n\r\n```ts\r\n// pages/index.spec.ts\r\n\r\nimport { describe, test, expect } from 'vitest'\r\nimport { setup, $fetch } from '@nuxt/test-utils'\r\n\r\ndescribe('My test', async () => {\r\n await setup({\r\n runner: 'vitest',\r\n })\r\n\r\n test('my test', () => {\r\n const html = $fetch('/')\r\n\r\n expect(html).toContain('Hello World!')\r\n })\r\n})\r\n```\n\n### Describe the bug\n\nDuring the `beforeAll` section of the `setup` in my test it crashes with this result:\r\n\r\n```\r\nError: [vite]: Rollup failed to resolve import \"jest\" from \"node_modules/@nuxt/test-utils/dist/index.mjs\".\r\nThis is most likely unintended because it can break your application at runtime.\r\nIf you do want to externalize this module explicitly add it to\r\n`build.rollupOptions.external`\r\n```\r\n\r\nThis is strange since the runner is clearly `vitest`, so it shouldnt be trying to import jest.\r\n\r\nTook a brief look at the `index.mjs` and my `hooks.ctx.options.runner` is properly recieving `vitest`.\r\n\r\nThe error ends with:\r\n\r\n```\r\n Segmentfault Error Detected \r\n FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.\r\n Refer to https://github.com/nodejs/node/issues/42407\r\n```\n\n### Additional context\n\nI havent been able to find a solid working example to base my own code. I was hoping this issue was just the RC version that I was using, but so far I havent had any luck with changing it. \r\n\r\nI tried cloning the `nuxt-ionic` repository as I saw it was on a later RC version and using vitest, however even with that I ran into issues. Is there a good working example I can be pointed in the direction of?\n\n### Logs\n\n```shell\n$ vitest run\r\n\r\n RUN v0.23.4 /Users/*********************/test-utils\r\n\r\n ❯ pages/index.spec.ts (1)\r\n 1: 0x103ab6ef5 node::Abort() (.cold.1) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n ❯ pages/index.spec.ts (1) 4104ms\r\n ❯ My test (1) 4103ms\r\n ⠙ [ beforeAll ]\r\n · my test\r\n\r\n 2: 0x1027aa869 node::Abort() [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n 3: 0x1027aa9df node::OnFatalError(char const*, char const*) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\n\r\n FAIL pages/index.spec.ts > My test\r\n 4: 0x10292ed00 v8::V8::ToLocalEmpty() [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\nError: [vite]: Rollup failed to resolve import \"jest\" from \"node_modules/@nuxt/test-utils/dist/index.mjs\".\r\nThis is most likely unintended because it can break your application at runtime.\r\nIf you do want to externalize this module explicitly add it to\r\n`build.rollupOptions.external`\r\n ❯ onRollupWarning node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:45908:19\r\n 5: 0x1027a596f node::fs::FSReqPromise\u003Cnode::AliasedBufferBase\u003Cdouble, v8::Float64Array, void> >::Resolve(v8::Local\u003Cv8::Value>) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n ❯ onwarn node_modules/vite/dist/node/chunks/dep-6b3a5aff.js:45706:13\r\n ❯ Object.onwarn node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23225:13\r\n ❯ ModuleLoader.handleResolveId node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22352:26\r\n ❯ ModuleLoader.resolveDynamicImport node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22404:120\r\n ❯ async file:/Users/*********************/test-utils/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:22299:32\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\n 6: 0x1027afa40 node::fs::AfterStat(uv_fs_s*) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n 7: 0x103176598 uv__work_done [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n 8: 0x10317b75b uv__async_io [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n 9: 0x10318f54b uv__io_poll [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\nSerialized Error: Object {\r\n \"watchFiles\": [Array],\r\n}\r\n10: 0x10317bce1 uv_run [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯\r\n\r\n11: 0x1026dbf9f node::SpinEventLoop(node::Environment*) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\nTest Files 1 failed (1)\r\n Tests (1)\r\n12: 0x102852cae node::worker::Worker::Run() [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n13: 0x1028566a2 node::worker::Worker::StartThread(v8::FunctionCallbackInfo\u003Cv8::Value> const&)::$_3::__invoke(void*) [/Users/*********************/.nvm/versions/node/v16.16.0/bin/node]\r\n14: 0x7ff8042ef4e1 _pthread_start [/usr/lib/system/libsystem_pthread.dylib]\r\n15: 0x7ff8042eaf6b thread_start [/usr/lib/system/libsystem_pthread.dylib]\r\n\r\n Segmentfault Error Detected \r\n FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.\r\n Refer to https://github.com/nodejs/node/issues/42407\r\n\r\nIt seems to be an upstream bug of Node.js. To improve the test stability,\r\nyou could pass --segfault-retry=3 or set env VITEST_SEGFAULT_RETRY=3 to\r\nhave Vitest auto retries on flaky segfaults.\r\n\r\nerror Command failed with exit code 1.\n```\n",[3060,3063,3064],{"name":3061,"color":3062},"3.x","29bc7f",{"name":3019,"color":3042},{"name":3065,"color":3066},"needs reproduction","FBCA04",15073,"closed","Unable to get a running env with `nuxt/test-utils`","2023-01-19T17:44:36Z","https://github.com/nuxt/nuxt/issues/15073",0.60978293,{"description":3074,"labels":3075,"number":3076,"owner":3022,"repository":3077,"state":3068,"title":3078,"updated_at":3079,"url":3080,"score":3081},"Nuxt 3.16.1\n\n```ts\n[8:47:30 PM] ERROR Pre-transform error: fetch failed\n Plugin: nuxt:fonts:font-family-injection\n File: /country/app/assets/css/tailwind.css\n```\n\n\n```ts\n fonts: {\n families: [\n { name: 'Inter', provider: 'google' },\n { name: 'JetBrains Mono', provider: 'google' },\n { name: 'IM Fell English', provider: 'google' },\n { name: 'Pirata One', provider: 'google' },\n {\n name: 'Fira Code',\n provider: 'google',\n weights: [400, 500],\n },\n ],\n },\n```",[],574,"fonts","Pre-transform error: fetch failed","2025-04-21T09:34:26Z","https://github.com/nuxt/fonts/issues/574",0.6167894,{"description":3083,"labels":3084,"number":3076,"owner":3022,"repository":3023,"state":3068,"title":3088,"updated_at":3089,"url":3090,"score":3081},"If I do not include a `nuxt.condfig.ts` in my root and configure vitest like so:\r\n```\r\nimport { fileURLToPath } from 'node:url'\r\nimport { defineVitestConfig } from 'nuxt-vitest/config'\r\n\r\nexport default defineVitestConfig({\r\n test: {\r\n coverage: {\r\n reportsDirectory: '../coverage',\r\n provider: 'c8',\r\n include: ['src/**'],\r\n exclude: ['src/**/*.spec.ts', 'src/**/*.test.ts', 'src/**/*.d.ts'],\r\n all: true\r\n },\r\n environmentOptions: {\r\n nuxt: {\r\n rootDir: fileURLToPath(new URL('./playground', import.meta.url))\r\n }\r\n },\r\n resolveSnapshotPath (path: string, extension: string) {\r\n return path + extension\r\n },\r\n setupFiles: ['./setup.ts']\r\n }\r\n})\r\n```\r\n\r\nI get\r\n```\r\nError: Failed to load nuxt-vitest module. You may need to add it to your nuxt.config.\r\n```\r\n\r\nWhere there is a nuxt config in my module's playground which includes `nuxt-vitest`",[3085],{"name":3086,"color":3087},"vitest-environment","b60205","allow configuring nuxt rootDir and overrides does not appear to work","2023-12-02T00:27:09Z","https://github.com/nuxt/test-utils/issues/574",{"description":3092,"labels":3093,"number":3096,"owner":3022,"repository":3022,"state":3068,"title":3097,"updated_at":3098,"url":3099,"score":3100},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v18.9.0`\r\n- Nuxt Version: `3.0.0-rc.11`\r\n- Nitro Version: `0.5.4`\r\n- Package Manager: `npm@8.19.1`\r\n- Builder: `vite`\r\n- User Config: `build`, `css`, `modules`, `runtimeConfig`\r\n- Runtime Modules: `@nuxt/image-edge@1.0.0-27716498.4c23770`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\nApologies, cannot provide due to work policies at my organization.\r\n\r\n### Describe the bug\r\n\r\nBasically I cannot find any way to install the Nuxt plugins I've used in my project while setting up the Vitest config for testing.\r\nI've tried to include the paths to my plugins in setupFiles in vitest.config.ts but doing that gave me an error like - Package import specifier \"#build/app.config.mjs\" is not defined in package. Currently this is my config - \r\n\r\n```\r\n// vitest.config.ts\r\n\r\nimport Vue from '@vitejs/plugin-vue';\r\nimport { resolve } from 'path';\r\nimport fs from 'fs'\r\nimport { defineConfig } from 'vitest/config';\r\nimport AutoImport from 'unplugin-auto-import/vite'\r\n\r\nconst NuxtTsConfig = (fs.readFileSync('./.nuxt/tsconfig.json')).toString()\r\nconst tsConfigFormated = JSON.parse(NuxtTsConfig\r\n .replace(/\\\\\"|\"(?:\\\\\"|[^\"])*\"|(\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\/)/g, (m, g) => g ? '' : m))\r\n\r\nconst r = (p: string) => resolve(__dirname, p)\r\n\r\nexport const alias: Record\u003Cstring, string> = {}\r\n\r\nObject.entries(tsConfigFormated.compilerOptions.paths)\r\n .forEach(([key, value]) => {\r\n alias[key] = r(value[0])\r\n })\r\n\r\nexport default defineConfig({\r\n root: '.',\r\n esbuild: {\r\n tsconfigRaw: '{}',\r\n },\r\n plugins: [\r\n Vue(),\r\n AutoImport({\r\n imports: [\r\n 'vue'\r\n ],\r\n dirs: [\r\n './composables',\r\n './components'\r\n ],\r\n dts: true\r\n })\r\n ],\r\n test: {\r\n globals: true,\r\n environment: 'jsdom',\r\n deps: {\r\n inline: [/@nuxt\\/test-utils-edge/],\r\n },\r\n setupFiles: ['./plugins/some-plugin.ts']\r\n },\r\n resolve: {\r\n alias: {\r\n ...alias,\r\n '#imports': r('./.nuxt/imports.d.ts')\r\n }\r\n }\r\n})\r\n```\r\nAnd this is one of the sample tests I tried to ran -\r\n\r\n```\r\n// login.test.ts\r\n\r\nimport { render, screen } from \"@testing-library/vue\";\r\nimport Login from '../pages/login/index.vue'\r\n\r\ndescribe('Login', async () => {\r\n const text = 'Test'\r\n it('should be span element', async () => {\r\n render(Login)\r\n const elem = await screen.findByText(text)\r\n console.log(elem)\r\n expect(elem.nodeName).toBe('SPAN')\r\n })\r\n})\r\n```\r\n@danielroe @pi0 \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_",[3094,3095],{"name":3061,"color":3062},{"name":3019,"color":3042},15004,"No way to install plugins with Vitest in Nuxt 3","2023-12-02T00:33:54Z","https://github.com/nuxt/nuxt/issues/15004",0.63002735,{"description":3102,"labels":3103,"number":3107,"owner":3022,"repository":3023,"state":3068,"title":3108,"updated_at":3109,"url":3110,"score":3111},"### 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```",[3104],{"name":3105,"color":3106},"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.6314932,{"labels":3113,"number":3117,"owner":3022,"repository":3022,"state":3068,"title":3118,"updated_at":3119,"url":3120,"score":3121},[3114,3115,3116],{"name":3061,"color":3062},{"name":3019,"color":3042},{"name":3065,"color":3066},14451,"createTest from @nuxt/test-utils-edge can't load nuxt","2023-01-19T17:35:34Z","https://github.com/nuxt/nuxt/issues/14451",0.6413065,["Reactive",3123],{},["Set"],["ShallowReactive",3126],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ftuzNbARnUhQWujL89LXA3gt4y6hiKWST2IuNNUFixIQ":-1},"/nuxt/nuxt/26898"]