\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.56351936,{"description":3027,"labels":3028,"number":3029,"owner":3019,"repository":3030,"state":3031,"title":3032,"updated_at":3033,"url":3034,"score":3025},"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":3027,"labels":3036,"number":3018,"owner":3019,"repository":3030,"state":3031,"title":3032,"updated_at":3037,"url":3038,"score":3025},[],"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/380",{"description":3027,"labels":3040,"number":3041,"owner":3019,"repository":3030,"state":3031,"title":3032,"updated_at":3042,"url":3043,"score":3025},[],481,"2023-12-02T00:13:13Z","https://github.com/nuxt/test-utils/issues/481",{"description":3045,"labels":3046,"number":3050,"owner":3019,"repository":3030,"state":3031,"title":3051,"updated_at":3052,"url":3053,"score":3054},"Try running `yarn test` in https://codesandbox.io/s/optimistic-maxwell-l1dmx?file=/tests/test.spec.js",[3047],{"name":3048,"color":3049},"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.62187433,{"description":3056,"labels":3057,"number":3064,"owner":3019,"repository":3030,"state":3031,"title":3065,"updated_at":3066,"url":3067,"score":3068},"### Environment\n\n- Operating System: Windows_NT\n- Node Version: v22.16.0\n- Nuxt Version: 3.17.5\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@10.9.2\n- Builder: -\n- User Config: runtimeConfig, ssr, alias, compatibilityDate, devtools, css, vite, modules\n- Runtime Modules: @nuxt/test-utils/module@3.19.1\n- Build Modules: -\n\n### Reproduction\n\n```json\n//package.json\n{\n \"name\": \"dummy-repo\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest\",\n },\n \"dependencies\": {\n \"nuxt\": \"^3.17.5\",\n \"vue\": \"^3.5.16\",\n },\n \"devDependencies\": {\n \"@nuxt/test-utils\": \"^3.19.1\",\n \"happy-dom\": \"^17.6.3\",\n \"vitest\": \"^3.2.3\"\n }\n}\n```\n\n```ts\n//nuxt.config.ts\nexport default defineNuxtConfig({\n ...\n modules: [\n '@nuxt/test-utils/module'\n ]\n})\n```\n\n```ts\n//vitest.config.ts\nimport { configDefaults } from 'vitest/config';\nimport { defineVitestConfig } from '@nuxt/test-utils/config';\nimport vue from '@vitejs/plugin-vue';\n\nexport default defineVitestConfig({\n test: {\n ...\n projects: [\n ...\n {\n plugins: [vue()],\n test: {\n environmentOptions: {\n nuxt: {\n url: 'http://localhost:3000',\n domEnvironment: 'happy-dom',\n // other properties...\n },\n },\n include: [\n 'tests/app.test.ts', //With dummy app.vue it can be empty template\n ],\n name: 'Nuxt Environment',\n globals: true,\n environment: 'nuxt',\n },\n },\n ],\n },\n})\n``\n\n### Describe the bug\n\nThere is a `import { defineComponent, useRouter, h, tryUseNuxtApp } from '#imports';` in @nuxt/test-utils in runtime-utils/index.mjs\n\nThe setup can not resolve it and I am stuck.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\nTypeError: Package import specifier \"#imports\" is not defined in package C:\\Users\\birgit.pohl\\Documents\\Github\\oracom-platform\\node_modules\\@nuxt\\test-utils\\package.json imported from C:\\Users\\birgit.pohl\\Documents\\Github\\oracom-platform\\node_modules\\@nuxt\\test-utils\\dist\\runtime-utils\\index.mjs\n```",[3058,3061],{"name":3059,"color":3060},"needs reproduction","DE7793",{"name":3062,"color":3063},"pending triage","5D08F5",1327,"TypeError: Package import specifier \"#imports\" is not defined","2025-07-01T12:54:22Z","https://github.com/nuxt/test-utils/issues/1327",0.6441815,{"description":3070,"labels":3071,"number":3075,"owner":3019,"repository":3030,"state":3031,"title":3076,"updated_at":3077,"url":3078,"score":3079},"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...",[3072],{"name":3073,"color":3074},"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.6494835,{"labels":3081,"number":3082,"owner":3019,"repository":3019,"state":3031,"title":3083,"updated_at":3084,"url":3085,"score":3086},[],14385,"\"SyntaxError: Cannot use import statement outside a module\" when i use 'firebase-admin'","2023-01-19T17:35:07Z","https://github.com/nuxt/nuxt/issues/14385",0.6580756,{"description":3088,"labels":3089,"number":3094,"owner":3019,"repository":3019,"state":3031,"title":3095,"updated_at":3096,"url":3097,"score":3098},"Is the new project unable to run now?\r\n\r\n···\r\n{\r\n \"name\": \"nuxt-app\",\r\n \"private\": true,\r\n \"type\": \"module\",\r\n \"scripts\": {\r\n \"build\": \"nuxt build\",\r\n \"dev\": \"nuxt dev\",\r\n \"generate\": \"nuxt generate\",\r\n \"preview\": \"nuxt preview\",\r\n \"postinstall\": \"nuxt prepare\"\r\n },\r\n \"dependencies\": {\r\n \"nuxt\": \"^3.13.0\",\r\n \"vue\": \"latest\",\r\n \"vue-router\": \"latest\"\r\n },\r\n \"packageManager\": \"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e\"\r\n}\r\n\r\n···\r\n\r\n\r\n```\r\n/usr/local/bin/npm run dev\r\n\r\n> dev\r\n> nuxt dev\r\n\r\n(node:72851) Warning: To load an ES module, set \"type\": \"module\" in the package.json or use the .mjs extension.\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\n/Users/xuzhibin/Desktop/Project/testNuxt3/node_modules/.bin/nuxt:2\r\nimport 'nuxi/cli'\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n at wrapSafe (node:internal/modules/cjs/loader:1378:20)\r\n at Module._compile (node:internal/modules/cjs/loader:1428:41)\r\n at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)\r\n at Module.load (node:internal/modules/cjs/loader:1288:32)\r\n at Module._load (node:internal/modules/cjs/loader:1104:12)\r\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)\r\n at node:internal/main/run_main_module:28:49\r\n\r\nNode.js v20.17.0\r\n\r\n```",[3090,3092],{"name":3062,"color":3091},"E99695",{"name":3059,"color":3093},"FBCA04",28916,"Is the new project unable to run now?","2024-09-11T15:21:18Z","https://github.com/nuxt/nuxt/issues/28916",0.66013247,{"labels":3100,"number":3105,"owner":3019,"repository":3019,"state":3031,"title":3106,"updated_at":3107,"url":3108,"score":3109},[3101,3102],{"name":3062,"color":3091},{"name":3103,"color":3104},"2.x","d4c5f9",7356," Cannot use import statement outside a module","2023-01-22T15:34:50Z","https://github.com/nuxt/nuxt/issues/7356",0.66082335,["Reactive",3111],{},["Set"],["ShallowReactive",3114],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fLEIMqQocsdx3ssHQTPM09P7k1z5vMFP5Lhq8ZNay1fc":-1},"/nuxt/test-utils/320"]