\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":2876,"labels":2877,"number":2881,"owner":2868,"repository":2882,"state":2883,"title":2884,"updated_at":2885,"url":2886,"score":2887},"",[2878],{"name":2879,"color":2880},"enhancement","a2eeef",284,"test-utils","closed","subpath import for vitest/jest support in `@nuxt/test-utils`","2024-05-01T16:06:39Z","https://github.com/nuxt/test-utils/issues/284",0.45983413,{"description":2889,"labels":2890,"number":2894,"owner":2868,"repository":2882,"state":2883,"title":2895,"updated_at":2896,"url":2897,"score":2898},"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...",[2891],{"name":2892,"color":2893},"vitest-environment","b60205",508,"`mockNuxtImport` failing to mock Nuxt auto imports","2023-12-02T00:22:09Z","https://github.com/nuxt/test-utils/issues/508",0.66662014,{"description":2900,"labels":2901,"number":2902,"owner":2868,"repository":2903,"state":2883,"title":2904,"updated_at":2905,"url":2906,"score":2907},"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.67060053,{"description":2909,"labels":2910,"number":2902,"owner":2868,"repository":2882,"state":2883,"title":2912,"updated_at":2913,"url":2914,"score":2907},"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`",[2911],{"name":2892,"color":2893},"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":2916,"labels":2917,"number":2927,"owner":2868,"repository":2868,"state":2883,"title":2928,"updated_at":2929,"url":2930,"score":2931},"### 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_",[2918,2921,2924],{"name":2919,"color":2920},"3.x","29bc7f",{"name":2922,"color":2923},"bug","d73a4a",{"name":2925,"color":2926},"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":2933,"number":2944,"owner":2868,"repository":2868,"state":2883,"title":2945,"updated_at":2946,"url":2947,"score":2948},[2934,2935,2938,2941],{"name":2919,"color":2920},{"name":2936,"color":2937},"vite","3574D1",{"name":2939,"color":2940},"webpack","650C6F",{"name":2942,"color":2943},"test","1DB6E0",13426,"Tests for `nuxt:dynamic-base-path`","2023-01-19T16:55:41Z","https://github.com/nuxt/nuxt/issues/13426",0.6826694,{"description":2950,"labels":2951,"number":2952,"owner":2868,"repository":2882,"state":2883,"title":2953,"updated_at":2954,"url":2955,"score":2956},"### 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.68620604,{"description":2950,"labels":2958,"number":2960,"owner":2868,"repository":2882,"state":2883,"title":2953,"updated_at":2961,"url":2962,"score":2963},[2959],{"name":2922,"color":2923},345,"2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.68681467,{"description":2965,"labels":2966,"number":2971,"owner":2868,"repository":2868,"state":2883,"title":2972,"updated_at":2973,"url":2974,"score":2975},"### 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_",[2967,2968],{"name":2919,"color":2920},{"name":2969,"color":2970},"pending triage","E99695",25021,"Vitest can't resolve import '#imports'(Nuxt3, vitest)","2024-06-21T04:50:44Z","https://github.com/nuxt/nuxt/issues/25021",0.6945295,["Reactive",2977],{},["Set"],["ShallowReactive",2980],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fQVEx1HwpUsoCaZNiKBpMBX8M03Di60iUhqrCODevhes":-1},"/nuxt/fonts/284"]