\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.64233464,{"description":1993,"labels":1994,"number":1998,"owner":1985,"repository":1999,"state":2000,"title":2001,"updated_at":2002,"url":2003,"score":2004},"When I tried to use the library I got this error: \r\n\r\n\r\nIf I only use jest or testing library they do work, I am quite confused. Any ideas?\r\n\r\nThis is my jest.config.js:\r\n```\r\nmodule.exports = {\r\n moduleNameMapper: {\r\n '^@/(.*)$': '\u003CrootDir>/$1',\r\n '^~/(.*)$': '\u003CrootDir>/$1',\r\n '^@atoms/(.*)$': '\u003CrootDir>/components/common/atoms/$1',\r\n '^@molecules/(.*)$': '\u003CrootDir>/components/common/molecules/$1',\r\n '^@organisms/(.*)$': '\u003CrootDir>/components/common/organisms/$1',\r\n '^@checkout/(.*)$': '\u003CrootDir>/components/private/checkout/$1',\r\n '^vue$': 'vue/dist/vue.common.js'\r\n },\r\n moduleFileExtensions: ['js', 'vue', 'json'],\r\n transform: {\r\n '^.+\\\\.js$': 'babel-jest',\r\n '.*\\\\.(vue)$': 'vue-jest'\r\n },\r\n collectCoverage: true,\r\n transformIgnorePatterns: [\r\n 'node_modules/(?!(nuxt-i18n)/)',\r\n 'node_modules/(?!(nuxt-webfontloader)/)',\r\n 'node_modules/(?!(nuxt-test-utils)/)'\r\n ],\r\n testEnvironment: 'jsdom',\r\n preset: '@nuxt/test-utils'\r\n}\r\n\r\n\r\n```\r\nThis is my package.json:\r\n```\r\n \"dependencies\": {\r\n \"@adyen/adyen-web\": \"^4.2.3\",\r\n \"@bugsnag/js\": \"^7.1.1\",\r\n \"@bugsnag/plugin-vue\": \"^7.1.1\",\r\n \"@nuxtjs/axios\": \"^5.3.6\",\r\n \"@nuxtjs/dayjs\": \"^1.3.0\",\r\n \"@nuxtjs/gtm\": \"^2.3.2\",\r\n \"@nuxtjs/pwa\": \"^3.3.5\",\r\n \"@nuxtjs/router\": \"^1.5.0\",\r\n \"@nuxtjs/svg-sprite\": \"^0.4.10\",\r\n \"@tailwindcss/aspect-ratio\": \"^0.2.0\",\r\n \"@tailwindcss/forms\": \"^0.3.2\",\r\n \"@tailwindcss/typography\": \"^0.4.0\",\r\n \"cookie-universal-nuxt\": \"^2.1.4\",\r\n \"core-js\": \"^2.6.0\",\r\n \"cross-env\": \"^5.2.0\",\r\n \"dotenv\": \"^8.2.0\",\r\n \"eslint-loader\": \"^4.0.2\",\r\n \"express\": \"^4.16.4\",\r\n \"jsdom\": \"^16.4.0\",\r\n \"lozad\": \"^1.15.0\",\r\n \"node-fetch\": \"^2.6.1\",\r\n \"nuxt\": \"2.15.4\",\r\n \"nuxt-feature-toggle\": \"^1.0.1\",\r\n \"nuxt-font-loader-strategy\": \"^1.1.1\",\r\n \"nuxt-i18n\": \"^6.15.4\",\r\n \"nuxt-jsonld\": \"^1.4.10\",\r\n \"nuxt-webfontloader\": \"^1.1.0\",\r\n \"v-click-outside\": \"^3.0.1\",\r\n \"v-clipboard\": \"^2.2.3\",\r\n \"vue-debounce\": \"^2.5.6\",\r\n \"vue-glide-js\": \"^1.3.14\",\r\n \"vue-gtm\": \"^2.3.1\",\r\n \"vue-slider-component\": \"^3.1.4\",\r\n \"vue-social-sharing\": \"^3.0.0-beta.11\",\r\n \"vue-toastification\": \"^1.7.6\",\r\n \"vue-vimeo-player\": \"^0.1.0\",\r\n \"vuelidate\": \"^0.7.5\"\r\n },\r\n \"devDependencies\": {\r\n \"@babel/core\": \"^7.7.7\",\r\n \"@babel/preset-env\": \"^7.15.0\",\r\n \"@babel/plugin-transform-runtime\": \"^7.15.0\",\r\n \"@nuxt/test-utils\": \"^0.2.2\",\r\n \"@nuxtjs/eslint-config\": \"^5.0.0\",\r\n \"@nuxtjs/eslint-module\": \"^3.0.1\",\r\n \"@nuxtjs/tailwindcss\": \"^4.1.2\",\r\n \"@testing-library/vue\": \"^5.8.2\",\r\n \"@vue/test-utils\": \"^1.1.2\",\r\n \"babel-eslint\": \"^10.0.1\",\r\n \"babel-jest\": \"26\",\r\n \"eslint\": \"^7.14.0\",\r\n \"eslint-config-prettier\": \"^6.15.0\",\r\n \"eslint-plugin-nuxt\": \"^2.0.0\",\r\n \"eslint-plugin-prettier\": \"^3.1.4\",\r\n \"jest\": \"26\",\r\n \"node-sass\": \"^4.14.1\",\r\n \"nodemon\": \"^1.18.9\",\r\n \"playwright\": \"^1.14.1\",\r\n \"postcss\": \"^8.2.9\",\r\n \"prettier\": \"^1.19.1\",\r\n \"sass-loader\": \"10.1.1\",\r\n \"vue-jest\": \"^4.0.0-rc.1\"\r\n }\r\n}\r\n```\r\n\r\n\r\nMy .babelrc: \r\n```\r\n{\r\n \"env\": {\r\n \"test\": {\r\n \"presets\": [\r\n [\r\n \"@babel/preset-env\",\r\n {\r\n \"targets\": {\r\n \"node\": \"current\"\r\n }\r\n }\r\n ]\r\n ]\r\n }\r\n }\r\n}\r\n```\r\n\r\n\r\nI am trying to use this test: \r\n\r\n`import { createPage, setupTest } from '@nuxt/test-utils'`\r\n\r\n`describe('browser', () => {`\r\n `setupTest({ browser: true })`\r\n\r\n ` it('renders the index page', async () => {`\r\n ` const page = await createPage('/')`\r\n ` const html = await page.innerHTML('body')`\r\n\r\n ` expect(html).toContain('Something')`\r\n` })`\r\n`})`\r\n\r\n",[1995],{"name":1996,"color":1997},"v0","4137F6",320,"test-utils","closed","\"Cannot use import statement outside a module\" when i use setupTest","2024-05-23T20:19:27Z","https://github.com/nuxt/test-utils/issues/320",0.62453115,{"labels":2006,"number":2013,"owner":1985,"repository":1985,"state":2000,"title":2014,"updated_at":2015,"url":2016,"score":2017},[2007,2010],{"name":2008,"color":2009},"3.x","29bc7f",{"name":2011,"color":2012},"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.63331467,{"labels":2019,"number":2020,"owner":1985,"repository":1985,"state":2000,"title":2014,"updated_at":2021,"url":2022,"score":2023},[],12018,"2023-01-19T15:54:17Z","https://github.com/nuxt/nuxt/issues/12018",0.6354267,{"labels":2025,"number":2026,"owner":1985,"repository":1985,"state":2000,"title":2014,"updated_at":2027,"url":2028,"score":2023},[],12321,"2023-01-19T16:02:56Z","https://github.com/nuxt/nuxt/issues/12321",{"description":2030,"labels":2031,"number":2032,"owner":1985,"repository":1999,"state":2000,"title":2033,"updated_at":2034,"url":2035,"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,"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":2030,"labels":2037,"number":1984,"owner":1985,"repository":1999,"state":2000,"title":2033,"updated_at":2038,"url":2039,"score":1991},[],"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/380",{"description":2030,"labels":2041,"number":2042,"owner":1985,"repository":1999,"state":2000,"title":2033,"updated_at":2043,"url":2044,"score":1991},[],481,"2023-12-02T00:13:13Z","https://github.com/nuxt/test-utils/issues/481",{"description":2046,"labels":2047,"number":2051,"owner":1985,"repository":1999,"state":2000,"title":2052,"updated_at":2053,"url":2054,"score":2055},"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...",[2048],{"name":2049,"color":2050},"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.65607077,{"description":2057,"labels":2058,"number":2066,"owner":1985,"repository":1985,"state":2000,"title":2067,"updated_at":2068,"url":2069,"score":2070},"### Environment\n\nOperating System: MacOS Ventura\r\nNode Version: v16.13.0.\r\nNuxt Version: 3.0.0-rc.9\r\nNitro Version: 0.5.0\r\nPackage Manager: yarn@1.22.19\r\nBuilder: webpack ( I think)\r\nUser Config:\r\nRuntime Modules:\r\n \"dependencies\": {\r\n \"@formkit/i18n\": \"^1.0.0-beta.10\",\r\n \"@pinia/nuxt\": \"^0.4.1\",\r\n \"axios\": \"^0.27.2\",\r\n \"pinia\": \"^2.0.21\",\r\n \"pinia-plugin-persistedstate\": \"^2.1.1\",\r\n \"postmark\": \"^3.0.1\",\r\n \"swiper\": \"^8.3.1\",\r\n \"vue3-marquee\": \"^3.0.7\"\r\n }\r\nBuild Modules:\r\n\"devDependencies\": {\r\n \"@aceforth/nuxt-netlify\": \"^1.1.0\",\r\n \"@formkit/nuxt\": \"^1.0.0-beta.11-0dd967c\",\r\n \"@iconify-json/heroicons-solid\": \"^1.1.1\",\r\n \"@nuxtjs/tailwindcss\": \"^5.3.2\",\r\n \"@tailwindcss/typography\": \"^0.5.7\",\r\n \"@vueuse/core\": \"^9.1.1\",\r\n \"@vueuse/nuxt\": \"^9.1.1\",\r\n \"netlify-cli\": \"^11.5.1\",\r\n \"nuxt\": \"3.0.0-rc.9\",\r\n \"unplugin-icons\": \"^0.14.5\"\r\n }\n\n### Reproduction\n\nI upgrade with yarn upgrade and with yarn upgrade nuxt, then yarn upgrade --force, and then yarn upgrade --latest.\r\nI upgraded to RC.9 and a few packages that didn't work I upgraded manually to the edge repository like formkit that needed yarn add @formkit/nuxt@next --dev .\r\n\r\nI'will try to make a minimal reproduction, but as the project has many pages and components Im not sure if I have to recreate the whole project.\n\n### Describe the bug\n\nWhen I do yarn build -> the site is completely broken it doesn't load any page.\r\nWhen I do yarn dev -> the site works ok\r\nWhen I do yarn check -> There is 1 error\r\n```\r\nerror \"@pinia/nuxt#unctx#unplugin#vite@^2.3.0\" doesn't satisfy found match of \"vite@3.0.9\"\r\nerror Found 1 errors.\r\n```\r\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n[nuxt] [request error] [unhandled] [500] Package import specifier \"#build/app.config.mjs\" is not defined in package /Users/david/WebstormProjects/mixverde/.output/server/node_modules/nuxt/package.json imported from /Users/david/WebstormProjects/mixverde/.output/server/node_modules/nuxt/dist/app/config.mjs\r\n at new NodeError (node:internal/errors:371:5) \r\n at throwImportNotDefined (node:internal/modules/esm/resolve:429:9) \r\n at packageImportsResolve (node:internal/modules/esm/resolve:778:3) \r\n at moduleResolve (node:internal/modules/esm/resolve:924:21) \r\n at defaultResolve (node:internal/modules/esm/resolve:1044:11) \r\n at ESMLoader.resolve (node:internal/modules/esm/loader:422:30) \r\n at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40) \r\n at ModuleWrap.\u003Canonymous> (node:internal/modules/esm/module_job:76:40) \r\n at link (node:internal/modules/esm/module_job:75:36)```\n```\n",[2059,2060,2063],{"name":2008,"color":2009},{"name":2061,"color":2062},"pending triage","E99695",{"name":2064,"color":2065},"needs reproduction","FBCA04",14801,"cannot import from `nuxt/app` (Package import specifier \"#build/app.config.mjs\" is not defined)","2023-12-02T00:33:51Z","https://github.com/nuxt/nuxt/issues/14801",0.6597942,["Reactive",2072],{},["Set"],["ShallowReactive",2075],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"vh-lJgJE_b--uYjeZmTPakzX6hBJL7Jqxa3FZ6Qw-IM":-1},"/nuxt/test-utils/283"]