\n\u003C!-- OR -->\n\u003CIcon name=\"my-icon:a\" v-if=\"flag\" />\n\u003CIcon name=\"my-icon:b\" v-else />\n```\nin `nuxt.config.ts`\n```ts\nicon: {\n provider: 'server',\n customCollections: [\n {\n prefix: 'my-icon',\n dir: './assets/icon/svg',\n },\n ],\n},\n// ...\nnitro: {\n preset: 'static',\n},\n```\n\nIf toggle value of `flag`, \neverything works well in development, \nbut it throws 404 error for `my-icon:b` after building and generating.\n(it works well with `v-show`) \n\nProject info:\n```\n------------------------------\n- Operating System: Windows_NT\n- Node Version: v22.8.0\n- Nuxt Version: 3.16.0\n- CLI Version: 3.23.0\n- Nitro Version: 2.11.6\n- Package Manager: pnpm@9.9.0\n- Builder: -\n- User Config: modules, icon, colorMode, shadcn, fonts, googleSignIn, app, imports, css, vite, nitro, compatibilityDate, telemetry\n- Runtime Modules: @nuxtjs/tailwindcss@6.13.2, @nuxt/icon@1.11.0, @nuxt/fonts@0.11.0, @nuxt/image@1.9.0, @nuxt/eslint@1.2.0, @pinia/nuxt@0.10.1, pinia-plugin-persistedstate/nuxt@4.2.0, @nuxt/test-utils/module@3.17.2, @nuxtjs/color-mode@3.5.2, shadcn-nuxt@1.0.3, @vueuse/nuxt@13.0.0, nuxt-vue3-google-signin@0.0.11\n- Build Modules: -\n------------------------------\n```\n",[],380,"nuxt","icon","open","Local icon 404 after `nuxi generating` if with `:name=\"flag?'my-icon:icon-a':'my-icon:icon-b'\"`","2025-03-26T15:31:52Z","https://github.com/nuxt/icon/issues/380",0.71045977,{"description":3154,"labels":3155,"number":3159,"owner":3146,"repository":3160,"state":3161,"title":3162,"updated_at":3163,"url":3164,"score":3165},"Regression between v0.8.0 and v0.9.0. Potential culprit: https://github.com/nuxt/fonts/issues/266\r\n\r\nAfter upgrading to v0.9.0, a statically generated project (using `nuxt generate`) is no longer getting fonts deployed to the `_fonts/` dir (in fact, the directory does not exist).\r\n\r\nEnvironment:\r\n- `nuxt v3.12.1`\r\n- `pnpm v9.11.0`\r\n- `nuxt/fonts v0.9.0`\r\n- build and runtime environment: netlify static site\r\n\r\nDowngrading to v0.8.0 fixes the issue.\r\n",[3156],{"name":3157,"color":3158},"bug","d73a4a",284,"fonts","closed","no _fonts dir deployed on cloud provider (netlify)","2024-09-25T18:17:33Z","https://github.com/nuxt/fonts/issues/284",0.45983413,{"description":3167,"labels":3168,"number":3172,"owner":3146,"repository":3173,"state":3161,"title":3174,"updated_at":3175,"url":3176,"score":3177},"Hey guys, today I upgraded `vitest` and `nuxt-vitest` to version [0.29.2](https://github.com/vitest-dev/vitest/releases/tag/v0.29.2) and [0.6.8](https://github.com/danielroe/nuxt-vitest/releases/tag/0.6.8), respectively.\r\n\r\nI upgraded `nuxt-vitest` because I upgraded `vitest` and installed `c8` for test coverage and I started getting the following error message on test runs:\r\n```\r\nError: Cannot find module 'vitest-environment-nuxt/module'\r\n```\r\n\r\nAnd after the `nuxt-vitest` upgrade, I started getting the following error:\r\n```\r\nError: Cannot find import \"useI18n\" to mock\r\n```\r\n\r\nAnd this happens when I try to mock `useI18n` (from `@nuxtjs/i18n`), which exists globally in my application:\r\n```javascript\r\nimport { mockNuxtImport } from 'nuxt-vitest/utils'\r\n\r\nmockNuxtImport('useI18n', () => {\r\n return () => {\r\n return {\r\n t: vi.fn()\r\n }\r\n }\r\n})\r\n```\r\n\r\nBefore all these upgrades, the mock was working properly.\r\nAnyone else with a similar problem?\r\n\r\n*EXTRA INFORMATION*\r\nOn the other hand...\r\nMy original approach to mock i18n started to work (didn't work before):\r\n```javascript\r\nimport { useI18n } from 'vue-i18n'\r\nimport { vi } from 'vitest'\r\n\r\nvi.mock('vue-i18n')\r\n\r\nuseI18n.mockReturnValue({\r\n t: (tKey) => tKey\r\n})\r\n```\r\nAnd I using this approach for now. And why it didn't work before is a mystery...",[3169],{"name":3170,"color":3171},"vitest-environment","b60205",508,"test-utils","`mockNuxtImport` failing to mock Nuxt auto imports","2023-12-02T00:22:09Z","https://github.com/nuxt/test-utils/issues/508",0.66662014,{"description":3179,"labels":3180,"number":3181,"owner":3146,"repository":3160,"state":3161,"title":3182,"updated_at":3183,"url":3184,"score":3185},"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,"Pre-transform error: fetch failed","2025-04-21T09:34:26Z","https://github.com/nuxt/fonts/issues/574",0.6706006,{"description":3187,"labels":3188,"number":3181,"owner":3146,"repository":3173,"state":3161,"title":3190,"updated_at":3191,"url":3192,"score":3185},"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`",[3189],{"name":3170,"color":3171},"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":3194,"labels":3195,"number":3203,"owner":3146,"repository":3146,"state":3161,"title":3204,"updated_at":3205,"url":3206,"score":3207},"### Environment\r\n\r\n- Nuxt Version: `3.0.0-rc.13`\r\n- `@nuxt/test-utils-edge` Version: `latest(3.0.0-rc.14-27796957.b60f136)`\r\n- Vitest Version: `^0.24.0`\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/github-raxmub-uprd1m?file=package.json\r\n\r\n### Describe the bug\r\n\r\nWith `vitest@^0.24.0` or the latest `0.25.0`, `nuxt test` will fail, and the following error occurs:\r\n```\r\nCannot find module '/path/to/project/node_modules/vitest/dist/node.mjs' imported from /path/to/project/node_modules/@nuxt/test-utils-edge/dist/index.mjs\r\n```\r\n\r\nWe should import `vitest/dist/node.js` rather than `vitest/dist/node.mjs`.\r\n\r\n### Additional context\r\n\r\nThe extension once changed to `.mjs` in https://github.com/vitest-dev/vitest/commit/692ad34 , but in https://github.com/vitest-dev/vitest/pull/1411 it was reverted and now using `.js`.\r\n\r\n[This PR(vitest-dev/vitest#1411)](https://github.com/vitest-dev/vitest/pull/1411) was merged and released as `v0.24.0` so using `v0.23.4` or former can also resolve this issue, but I can't see it as the best way.\r\n\r\n### Logs\r\n\r\n_No response_",[3196,3199,3200],{"name":3197,"color":3198},"3.x","29bc7f",{"name":3157,"color":3158},{"name":3201,"color":3202},"chore","D0F1A9",15404,"`@nuxt/test-utils-edge` doesn't work with `vitest` v0.24.0 or later","2023-01-19T17:49:44Z","https://github.com/nuxt/nuxt/issues/15404",0.6752184,{"labels":3209,"number":3220,"owner":3146,"repository":3146,"state":3161,"title":3221,"updated_at":3222,"url":3223,"score":3224},[3210,3211,3214,3217],{"name":3197,"color":3198},{"name":3212,"color":3213},"vite","3574D1",{"name":3215,"color":3216},"webpack","650C6F",{"name":3218,"color":3219},"test","1DB6E0",13426,"Tests for `nuxt:dynamic-base-path`","2023-01-19T16:55:41Z","https://github.com/nuxt/nuxt/issues/13426",0.6826694,{"description":3226,"labels":3227,"number":3228,"owner":3146,"repository":3173,"state":3161,"title":3229,"updated_at":3230,"url":3231,"score":3232},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0-rc.8`\r\n- Package Manager: `npm@7.17.0`\r\n- Builder: `vite`\r\n- User Config: `modules`\r\n- Runtime Modules: `vite-plugin-vue-type-imports/nuxt`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\n#### How to recreate\r\n\r\nFor every link:\r\n\r\n1. Open a link.\r\n2. Wait for a development server is start and the Nuxt Welcome page is loaded.\r\n4. Press \u003Ckbd>Ctrl\u003C/kbd> + \u003Ckbd>C\u003C/kbd> in Terminal.\r\n5. Run `npm test`.\r\n\r\n#### Broken\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-82agcd?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a bundled Nuxt module from the `node_modules` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n 'vite-plugin-vue-type-imports/nuxt',\r\n ],\r\n});\r\n```\r\n\r\n#### Working\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-dyj8f8?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a local Nuxt module from the `modules/` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n '~/modules/vite-plugin-vue-type-imports.ts',\r\n ],\r\n});\r\n```\r\n\r\n### Describe the bug\r\n\r\nThe `vite-plugin-vue-type-imports/nuxt` module added in `nuxt.config.ts` is:\r\n\r\n* works when loaded via `npm run dev`;\r\n* broken if loaded via `npm test` (`nuxt test` or `vitest` with `@nuxt/test-utils-edge`).\r\n\r\n### Additional context\r\n\r\nThe [same Nuxt module code](https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/370fcea9c7a09a0961bdf6e29b0795963034eb1e/src/nuxt.ts) is works with `npm test` if copy-pasted and loaded as a local plugin from the `modules/` directory.\r\n\r\n### Logs\r\n\r\n```shell\r\nERROR TypeError: Invalid URL 22:18:50\r\n\r\n ❯ TypeError.get https:/github-owtwqh-82agcd.w.staticblitz.com/blitz.df64f655701fde45529fa8e152b3842072335b47.js:6:292488\r\n 22:18:50\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\nSerialized Error: { 22:18:50\r\n \"code\": \"ERR_INVALID_URL\",\r\n \"input\": \"//\",\r\n}\r\n```\r\n",[],429,"Vitest with `@nuxt/test-utils-edge` breaks imported `vite-plugin-vue-type-imports/nuxt` module, but works if same module code is recreated locally","2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/429",0.686206,{"description":3226,"labels":3234,"number":3236,"owner":3146,"repository":3173,"state":3161,"title":3229,"updated_at":3237,"url":3238,"score":3239},[3235],{"name":3157,"color":3158},345,"2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.68681467,{"description":3241,"labels":3242,"number":3243,"owner":3146,"repository":3173,"state":3161,"title":3244,"updated_at":3245,"url":3246,"score":3247},"Good morning,\n\nI recently moved from nuxt-vitest to @nuxt/test-utils in a nuxt 3 project.\nI followed steps reported here: https://github.com/nuxt/test-utils/releases/tag/v3.9.0\nAnd I updraded nuxt/test-utils to 3.19.1\n\n\"@nuxt/test-utils\": \"^3.19.1\",\n\"vitest\": \"^3.2.4\",\n\"vitest-environment-nuxt\": \"^1.0.0\"\n\"happy-dom\": \"^17.0.0\",\n\"@vue/test-utils\": \"2.4.6\",\n\"@vitest/coverage-v8\": \"^3.2.4\",\n\nwhen I try to lunch nuxt dev, I get this error in localhost\n\n\n\u003Cimg width=\"1215\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/ab70f400-c723-4953-92d8-0025c7acfdd9\" />\n\n\nI already checked for some vitest import outside test files, but I didn't find it.\nI did something wrong, or is this a bug?\n\n\nedit: tests works fine",[],1343,"Vitest failed to access its internal state","2025-07-01T09:10:36Z","https://github.com/nuxt/test-utils/issues/1343",0.69037217,["Reactive",3249],{},["Set"],["ShallowReactive",3252],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f9cM3aiv1fj2dWYwT774gUlL6JnqprNOQYP-tIO9sMGI":-1},"/nuxt/test-utils/284"]