\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.6345816,{"description":2865,"labels":2866,"number":2873,"owner":2857,"repository":2857,"state":2874,"title":2875,"updated_at":2876,"url":2877,"score":2878},"### 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_",[2867,2870],{"name":2868,"color":2869},"3.x","29bc7f",{"name":2871,"color":2872},"pending triage","E99695",25021,"closed","Vitest can't resolve import '#imports'(Nuxt3, vitest)","2024-06-21T04:50:44Z","https://github.com/nuxt/nuxt/issues/25021",0.6249177,{"description":2880,"labels":2881,"number":2882,"owner":2857,"repository":2883,"state":2874,"title":2884,"updated_at":2885,"url":2886,"score":2863},"Example in https://test-utils.nuxtjs.org/api-reference/app-testing not working. \r\nAfter run test get error:\r\n\r\n```\r\n/firsttest.spec.js:1\r\n({\"Object.\u003Canonymous>\":function(module,exports,require,__dirname,__filename,global,jest){import { get, setupTest } from '@nuxt/test-utils';\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n```\r\nmy setup:\r\n\r\nin jest.config.js\r\n```\r\nmodule.exports = {\r\n clearMocks: true,\r\n testMatch: [\r\n '*/__tests__/**/*.[jt]s?(x)',\r\n '**/?(*.)+(spec|test).[tj]s?(x)',\r\n '**/test/(*.)+(spec|test).js'],\r\n moduleNameMapper: {\r\n '^@/(.*)$': '\u003CrootDir>/$1',\r\n '^~/(.*)$': '\u003CrootDir>/$1',\r\n },\r\n moduleFileExtensions: ['js', 'vue', 'json'],\r\n testEnvironment: 'jsdom',\r\n transform: {\r\n '^.+\\\\.js$': 'babel-jest',\r\n '.*\\\\.(vue)$': 'vue-jest',\r\n },\r\n preset: '@nuxt/test-utils',\r\n}\r\n```\r\nin package.json\r\n```\r\n{\r\n \"name\": \"\",\r\n \"version\": \"1.0.0\",\r\n \"main\": \"index.js\",\r\n \"scripts\": {\r\n \"test\": \"node_modules/.bin/jest\"\r\n },\r\n \"author\": \"\",\r\n \"license\": \"\",\r\n \"dependencies\": {\r\n \"bootstrap\": \"^4.5.3\",\r\n \"bootstrap-vue\": \"^2.20.1\",\r\n \"nuxt\": \"^2.15.2\",\r\n\r\n },\r\n \"devDependencies\": {\r\n \"@babel/plugin-transform-modules-commonjs\": \"^7.12.1\",\r\n \"@nuxt/test-utils\": \"^0.2.0\",\r\n \"@vue/test-utils\": \"^1.1.1\",\r\n \"babel-jest\": \"^26.6.3\",\r\n \"jest\": \"^26.6.3\",\r\n \"vue-jest\": \"^3.0.7\"\r\n }\r\n}\r\n\r\n```\r\n\r\n\r\n",[],267,"test-utils","Example in https://test-utils.nuxtjs.org/api-reference/app-testing not working","2023-12-02T00:28:12Z","https://github.com/nuxt/test-utils/issues/267",{"description":2880,"labels":2888,"number":2856,"owner":2857,"repository":2883,"state":2874,"title":2884,"updated_at":2889,"url":2890,"score":2863},[],"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/380",{"description":2880,"labels":2892,"number":377,"owner":2857,"repository":2883,"state":2874,"title":2884,"updated_at":2893,"url":2894,"score":2863},[],"2023-12-02T00:13:13Z","https://github.com/nuxt/test-utils/issues/481",{"description":2896,"labels":2897,"number":2898,"owner":2857,"repository":2883,"state":2874,"title":2899,"updated_at":2889,"url":2900,"score":2901},"### 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","https://github.com/nuxt/test-utils/issues/429",0.6392003,{"description":2903,"labels":2904,"number":2907,"owner":2857,"repository":2883,"state":2874,"title":2908,"updated_at":2909,"url":2910,"score":2911},"### Environment\n\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.9.0\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: pnpm@8.10.5\r\n- Builder: -\r\n- User Config: modules, devtools, runtimeConfig\r\n- Runtime Modules: @nuxt/test-utils/module@3.9.0, ()\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nWith the latest nuxt test-utils I was trying to mock a server side import. Before even able to mock the server side import, I have realized that the plain vanilla minimal nuxt module seems to be ignored/not executed when running e2e test. \r\n\r\nSee repro here:\r\nhttps://stackblitz.com/edit/nuxt-vitest-x6ycht\r\n\n\n### Describe the bug\n\nBasic setup is to have a server side import coming from a module. an API is using that import to return a value. Running `pnpm dev` works, and the API returns the value as expected.\r\n\r\nRunning an E2E test in the nuxt environment however fails, showing error messages which are hinting that the module import has not been executed:\r\n\r\n`(node-resolve plugin) Could not resolve import \"#auth\" in /home/projects/nuxt-vitest-x6ycht/server/api/test.get.ts using imports defined in /home/projects/nuxt-vitest-x6ycht/package.json.`\r\n\r\nMaybe my test config needs to be improved? Or is it a bug?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2905],{"name":2871,"color":2906},"5D08F5",677,"Nuxt module import in E2E environment","2023-12-26T20:05:15Z","https://github.com/nuxt/test-utils/issues/677",0.64581275,{"description":2896,"labels":2913,"number":2917,"owner":2857,"repository":2883,"state":2874,"title":2899,"updated_at":2918,"url":2919,"score":2920},[2914],{"name":2915,"color":2916},"bug","d73a4a",345,"2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.6459313,{"description":2922,"labels":2923,"number":2931,"owner":2857,"repository":2883,"state":2874,"title":2932,"updated_at":2933,"url":2934,"score":2935},"### Environment\n\n- Node Version: v20.18.1\n- Nuxt Version: 3.8.2\n- CLI Version: 3.10.0\n- Nitro Version: 2.8.1\n- Package Manager: yarn@1.22.22\n- Builder: -\n- User Config: ssr, experimental, runtimeConfig, modules, site, ui, colorMode, pwa, tailwindcss, i18n, viewport, imports, devtools, typescript, alias, routeRules, $production\n- Runtime Modules: @nuxtjs/google-fonts@3.1.3, @nuxt/image@1.0.0-rc.3, nuxt-schema-org@3.2.3, nuxt-icon@0.4.2, @nuxtjs/i18n@8.0.0-rc.11, nuxt-viewport@2.0.6, @nuxtjs/device@3.1.1, @nuxt/ui@2.11.1, @vueuse/nuxt@10.7.0, @vite-pwa/nuxt@0.3.5, @artmizu/nuxt-prometheus@2.4.0\n\n### Reproduction\n\n1. exec yarn add --dev @nuxt/test-utils@3.9.0\n2. yarn build\n\n### Describe the bug\n\ncheck yarn.lock, it generate this info:\nvitest-environment-nuxt@^1.0.0, vitest-environment-nuxt@^1.0.1:\n version \"1.0.1\"\n resolved \"https://registry.npmmirror.com/vitest-environment-nuxt/-/vitest-environment-nuxt-1.0.1.tgz#e3308454af1947dbc315ce2a805a9d4fe4d1c49a\"\n integrity sha512-eBCwtIQriXW5/M49FjqNKfnlJYlG2LWMSNFsRVKomc8CaMqmhQPBS5LZ9DlgYL9T8xIVsiA6RZn2lk7vxov3Ow==\n dependencies:\n \"@nuxt/test-utils\" \">=3.13.1\"\n\nI think this version default vitest-environment-nuxt@^1.0.0, and not auto import 1.0.1, it will occur compatible problem in low version\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2924,2927,2928],{"name":2925,"color":2926},"needs reproduction","DE7793",{"name":2871,"color":2906},{"name":2929,"color":2930},"closed-by-bot","ededed",1260,"About test-utils import vitest-environment-nuxt@^1.0.1 occur compatible problem","2025-05-05T02:14:50Z","https://github.com/nuxt/test-utils/issues/1260",0.6490831,{"description":2937,"labels":2938,"number":2942,"owner":2857,"repository":2883,"state":2874,"title":2943,"updated_at":2944,"url":2945,"score":2946},"Try running `yarn test` in https://codesandbox.io/s/optimistic-maxwell-l1dmx?file=/tests/test.spec.js",[2939],{"name":2940,"color":2941},"v0","4137F6",283,"\"Cannot use import statement outside a module\" while using with nuxt-i18n","2024-05-01T16:05:10Z","https://github.com/nuxt/test-utils/issues/283",0.65176094,["Reactive",2948],{},["Set"],["ShallowReactive",2951],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fbzTmmGFQ8wyekEgbECqGiDx0hrsHXtxP4iwtxbPqlfw":-1},"/nuxt/test-utils/508"]