\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":2865,"labels":2866,"number":2867,"owner":2857,"repository":2868,"state":2869,"title":2870,"updated_at":2871,"url":2872,"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","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":2865,"labels":2874,"number":2856,"owner":2857,"repository":2868,"state":2869,"title":2870,"updated_at":2875,"url":2876,"score":2863},[],"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/380",{"description":2865,"labels":2878,"number":377,"owner":2857,"repository":2868,"state":2869,"title":2870,"updated_at":2879,"url":2880,"score":2863},[],"2023-12-02T00:13:13Z","https://github.com/nuxt/test-utils/issues/481",{"description":2882,"labels":2883,"number":2887,"owner":2857,"repository":2868,"state":2869,"title":2888,"updated_at":2889,"url":2890,"score":2891},"Try running `yarn test` in https://codesandbox.io/s/optimistic-maxwell-l1dmx?file=/tests/test.spec.js",[2884],{"name":2885,"color":2886},"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":2893,"labels":2894,"number":2898,"owner":2857,"repository":2868,"state":2869,"title":2899,"updated_at":2900,"url":2901,"score":2902},"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...",[2895],{"name":2896,"color":2897},"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":2904,"number":2905,"owner":2857,"repository":2857,"state":2869,"title":2906,"updated_at":2907,"url":2908,"score":2909},[],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":2911,"labels":2912,"number":2919,"owner":2857,"repository":2857,"state":2869,"title":2920,"updated_at":2921,"url":2922,"score":2923},"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```",[2913,2916],{"name":2914,"color":2915},"pending triage","E99695",{"name":2917,"color":2918},"needs reproduction","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":2925,"number":2930,"owner":2857,"repository":2857,"state":2869,"title":2931,"updated_at":2932,"url":2933,"score":2934},[2926,2927],{"name":2914,"color":2915},{"name":2928,"color":2929},"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,{"labels":2936,"number":2943,"owner":2857,"repository":2857,"state":2869,"title":2944,"updated_at":2945,"url":2946,"score":2947},[2937,2940],{"name":2938,"color":2939},"3.x","29bc7f",{"name":2941,"color":2942},"bug","d73a4a",11970,"SyntaxError: Cannot use import statement outside a module (Nuxt 3 + heroicons/vue + headlessui/vue)","2023-01-19T16:08:30Z","https://github.com/nuxt/nuxt/issues/11970",0.66367066,["Reactive",2949],{},["Set"],["ShallowReactive",2952],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fLEIMqQocsdx3ssHQTPM09P7k1z5vMFP5Lhq8ZNay1fc":-1},"/nuxt/test-utils/320"]