\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).",[3153],{"name":3140,"color":3141},1322,"Support Vitest `projects` option for Browser Mode","2025-06-18T13:51:03Z","https://github.com/nuxt/test-utils/issues/1322",0.63350815,{"description":3160,"labels":3161,"number":3164,"owner":3143,"repository":3143,"state":3145,"title":3165,"updated_at":3166,"url":3167,"score":3168},"### 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```",[3162],{"name":3140,"color":3163},"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":3170,"labels":3171,"number":3179,"owner":3143,"repository":3143,"state":3180,"title":3181,"updated_at":3182,"url":3183,"score":3184},"### 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",[3172,3175,3176],{"name":3173,"color":3174},"3.x","29bc7f",{"name":3140,"color":3163},{"name":3177,"color":3178},"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":3186,"labels":3187,"number":3188,"owner":3143,"repository":3189,"state":3180,"title":3190,"updated_at":3191,"url":3192,"score":3193},"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":3195,"labels":3196,"number":3188,"owner":3143,"repository":3144,"state":3180,"title":3200,"updated_at":3201,"url":3202,"score":3193},"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`",[3197],{"name":3198,"color":3199},"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":3204,"labels":3205,"number":3208,"owner":3143,"repository":3143,"state":3180,"title":3209,"updated_at":3210,"url":3211,"score":3212},"### 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_",[3206,3207],{"name":3173,"color":3174},{"name":3140,"color":3163},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":3214,"labels":3215,"number":3219,"owner":3143,"repository":3144,"state":3180,"title":3220,"updated_at":3221,"url":3222,"score":3223},"### 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```",[3216],{"name":3217,"color":3218},"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,{"description":3225,"labels":3226,"number":3228,"owner":3143,"repository":3144,"state":3180,"title":3229,"updated_at":3230,"url":3231,"score":3232},"### Environment\n\n- Operating System: `Linux`\n- Node Version: `v22.14.0`\n- Nuxt Version: `4.0.2`\n- CLI Version: `3.27.0`\n- Nitro Version: `2.12.4`\n- Package Manager: `yarn@1.22.22`\n- Builder: `-`\n- User Config: `-`\n- Runtime Modules: `-`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-rh3mlpir\n\n### Describe the bug\n\nSince I updated my module's nuxt version to `4.0.2` I can't run my tests anymore.\nLocally I get this error\n```\n➜ shared git:(dependabot/npm_and_yarn/nuxt-4.0.2) yarn test\nyarn run v1.22.22\n$ vitest run\nfailed to load config from /home/joenn/code/leexi/shared/vitest.config.ts\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\nAggregateError: Failed to initialize projects. There were errors during projects setup. See below for more details.\n at resolveProjects (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:7486:27)\n at async Vitest._setServer (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:9319:20)\n at async BasicMinimalPluginContext.handler (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10169:6)\n at async _createServer (file:///home/joenn/code/leexi/shared/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:28570:86)\n at async createViteServer (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:6911:17)\n at async createVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10202:17)\n at async prepareVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10541:14)\n at async startVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10488:14)\n at async start (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1412:15)\n at async CAC.run (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1391:2) {\n [errors]: [\n Error: Nuxt instance is unavailable!\n at useNuxt (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/node_modules/@nuxt/kit/dist/index.mjs:43:11)\n at useNitro (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/node_modules/@nuxt/kit/dist/index.mjs:795:16)\n at useResolveFromPublicAssets (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:666:17)\n at PublicDirsPlugin (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:573:39)\n at bundle (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:1662:11)\n at async bundle (file:///home/joenn/code/leexi/shared/node_modules/nuxt/dist/index.mjs:7275:5)\n at async build (file:///home/joenn/code/leexi/shared/node_modules/nuxt/dist/index.mjs:7135:3)\n ]\n}\n\n\n\nerror Command failed with exit code 1.\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n```\n\n---\n\nIn the reproduction a similar error can be found when running `yarn test`\n```\n~/projects/bnmijrqrzb.github 13s\n❯ yarn test\nyarn run v1.22.19\n$ vitest run\n(node:399) ExperimentalWarning: WASI is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\nfailed to load config from /home/projects/bnmijrqrzb.github/vitest.config.ts\n[warn] Overriding NuxtWelcome component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLayout component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtErrorBoundary component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding ClientOnly component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding DevOnly component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding ServerPlaceholder component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLink component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLoadingIndicator component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtTime component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtRouteAnnouncer component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtImg component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtPicture component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtIsland component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\nAggregateError: Failed to initialize projects. There were errors during projects setup. See below for more details.\n at resolveProjects (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:7515:27)\n at async Vitest._setServer (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:9348:20)\n at async BasicMinimalPluginContext.handler (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10198:6)\n at async _createServer (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:28667:86)\n at async createViteServer (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:6940:17)\n at async createVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10231:17)\n at async prepareVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10570:14)\n at async startVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10517:14)\n at async start (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1429:15)\n at async CAC.run (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1408:2) {\n [errors]: [\n Error: Nitro is not initialized yet. You can call `useNitro()` only after `ready` hook.\n at Module.useNitro (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/kit/dist/index.mjs:890:11)\n at initNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/nuxt/dist/index.mjs:5772:27)\n at async loadNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/nuxt/dist/index.mjs:5864:5)\n at async Module.loadNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/node_modules/@nuxt/kit/dist/index.mjs:2822:19)\n at async startNuxtAndGetViteConfig (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:57:16)\n at async getVitestConfigFromNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:111:15)\n at async resolveConfig (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:297:5)\n at async eval (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:242:28)\n at async loadConfigFromFile (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:36439:20)\n at async resolveConfig (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:36093:22)\n ]\n}\n\n\n\nerror Command failed with exit code 1.\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n```\n\n---\n\nDeleting the `vitest.config.ts` file resolves the issue but I want to define a custom config file to add aliases to vitest as well as configure some of the test options\n```ts\nimport path from 'path';\nimport { defineVitestConfig } from '@nuxt/test-utils/config';\n\nexport default defineVitestConfig({\n resolve: {\n alias: {\n '~': path.resolve(__dirname),\n },\n },\n test: {\n environment: 'happy-dom',\n globals: true,\n reporters: 'verbose',\n },\n});\n```\n",[3227],{"name":3140,"color":3141},1375,"Can't define custom vitest.config file anymore since Nuxt 4","2025-08-05T11:21:42Z","https://github.com/nuxt/test-utils/issues/1375",0.6364677,{"labels":3234,"number":3238,"owner":3143,"repository":3143,"state":3180,"title":3239,"updated_at":3240,"url":3241,"score":3242},[3235,3236,3237],{"name":3173,"color":3174},{"name":3140,"color":3163},{"name":3177,"color":3178},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",3244],{},["Set"],["ShallowReactive",3247],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ftuzNbARnUhQWujL89LXA3gt4y6hiKWST2IuNNUFixIQ":-1},"/nuxt/nuxt/26898"]