\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.64084786,{"description":1993,"labels":1994,"number":1995,"owner":1985,"repository":1996,"state":1997,"title":1998,"updated_at":1999,"url":2000,"score":1991},"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","closed","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":1993,"labels":2002,"number":1984,"owner":1985,"repository":1996,"state":1997,"title":1998,"updated_at":2003,"url":2004,"score":1991},[],"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/380",{"description":1993,"labels":2006,"number":2007,"owner":1985,"repository":1996,"state":1997,"title":1998,"updated_at":2008,"url":2009,"score":1991},[],481,"2023-12-02T00:13:13Z","https://github.com/nuxt/test-utils/issues/481",{"description":2011,"labels":2012,"number":2019,"owner":1985,"repository":1985,"state":1997,"title":2020,"updated_at":2021,"url":2022,"score":2023},"### 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_",[2013,2016],{"name":2014,"color":2015},"3.x","29bc7f",{"name":2017,"color":2018},"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.6430754,{"description":2025,"labels":2026,"number":2027,"owner":1985,"repository":1996,"state":1997,"title":2028,"updated_at":2003,"url":2029,"score":2030},"### 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.64690334,{"labels":2032,"number":2038,"owner":1985,"repository":1985,"state":1997,"title":2039,"updated_at":2040,"url":2041,"score":2042},[2033,2034,2035],{"name":2014,"color":2015},{"name":2017,"color":2018},{"name":2036,"color":2037},"nitro","bfd4f2",12739,"Api function imports are not transpiled","2023-01-19T16:21:24Z","https://github.com/nuxt/nuxt/issues/12739",0.6475973,{"description":2025,"labels":2044,"number":2048,"owner":1985,"repository":1996,"state":1997,"title":2028,"updated_at":2049,"url":2050,"score":2051},[2045],{"name":2046,"color":2047},"bug","d73a4a",345,"2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.6507493,{"description":2053,"labels":2054,"number":2058,"owner":1985,"repository":1996,"state":1997,"title":2059,"updated_at":2060,"url":2061,"score":2062},"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`",[2055],{"name":2056,"color":2057},"vitest-environment","b60205",574,"allow configuring nuxt rootDir and overrides does not appear to work","2023-12-02T00:27:09Z","https://github.com/nuxt/test-utils/issues/574",0.6556011,{"description":2064,"labels":2065,"number":2067,"owner":1985,"repository":1985,"state":1997,"title":2068,"updated_at":2069,"url":2070,"score":2071},"### Environment\n\nwhen I try to use functionality in utils folders of a nuxt project in tests, they don't get auto-imported\n\n\n``` ❯ test/auto.test.ts (1 test | 1 failed) 4052ms\n × auto test > test import 1ms\n → serverUtilsTest is not defined\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\n\n FAIL test/auto.test.ts > auto test > test import\nReferenceError: serverUtilsTest is not defined\n ❯ test/auto.test.ts:8:20\n 6|\n 7| it('test import', () => {\n 8| const result = serverUtilsTest()\n | ^\n 9| expect(result).toBe('serverUtilsTest')\n 10| })\n```\n\nhere is my `server/utils/test.ts` file\n```ts\nexport function serverUtilsTest() {\n return 'serverUtilsTest'\n}\n```\n\nand here is my `test/auto.test.ts` file\n```ts\nimport { describe, it, expect } from 'vitest'\nimport { setup } from '@nuxt/test-utils'\n\ndescribe('auto test', async () => {\n await setup({ dev: true })\n\n it('test import', () => {\n const result = serverUtilsTest()\n expect(result).toBe('serverUtilsTest')\n })\n})\n```\n\nrepo for reproduction https://github.com/acidjazz/auto-import-test\n\n### Reproduction\n\nrun `pnpm run test` in repo https://github.com/acidjazz/auto-import-test\n\n### Describe the bug\n\n@nuxt/test-utils setup() should take care of all auto-imports in utils folders\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2066],{"name":2017,"color":2018},30699,"auto-imports of utils folders not working in tests using @nuxt/test-utils","2025-01-22T17:53:23Z","https://github.com/nuxt/nuxt/issues/30699",0.65629053,["Reactive",2073],{},["Set"],["ShallowReactive",2076],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"bzTmmGFQ8wyekEgbECqGiDx0hrsHXtxP4iwtxbPqlfw":-1},"/nuxt/test-utils/508"]