\r\n\u003C/template>\r\n\u003Cscript setup lang=\"ts\">\u003C/script>\r\n```\r\n\r\nApp.vue\r\n```\r\n\u003Ctemplate>\r\n \u003Cdiv>Message: {{ getMessage(\"Hello World\") }}\u003C/div>\r\n\u003C/template>\r\n\u003Cscript setup lang=\"ts\">\r\nimport { getMessage } from \"@/service/message-service\";\r\n```\r\n\r\nApp.test.ts\r\n```\r\nimport { it, expect, vi } from \"vitest\";\r\nimport { mountSuspended } from \"@nuxt/test-utils/runtime\";\r\nimport App from \"../../layouts/default.vue\";\r\n\r\nvi.mock(\"@/service/message-service\", () => {\r\n return {\r\n getMessage: () => \"hello from mock!!\",\r\n };\r\n});\r\n\r\n\r\nit(\"nuxt unit testing\", async () => {\r\n const component = await mountSuspended(App, { route: \"/\" });\r\n expect(component.html()).toMatchInlineSnapshot(\r\n `\"\u003Cdiv>Message: hello Hello World\u003C/div>\"`\r\n );\r\n});\r\n\r\n```\r\n\r\nmessage-service.ts\r\n```\r\nexport function getMessage(message: string): string {\r\n console.log(\"FROM ACTUAL\");\r\n return `hell ${message}`;\r\n}\r\n```\r\n\n\n### Describe the bug\n\nI was expecting vitest vi.mock should be able to mock imports to provide custom/mock implementation, however it seems that vi.mock is not working in the context of nuxt test?\r\n\r\nIf so, how are we suppose to create unit tests and/or E2E using nuxt/test-utils package and be able to provide flexible mocking mechanism?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2004,2007,2010],{"name":2005,"color":2006},"bug","d73a4a",{"name":2008,"color":2009},"vitest-environment","b60205",{"name":2011,"color":2012},"pending triage","5D08F5",935,"test-utils","How to mock custom imports while using mountSuspended to test","2024-09-09T02:17:10Z","https://github.com/nuxt/test-utils/issues/935",0.7471895,{"description":2020,"labels":2021,"number":2023,"owner":1985,"repository":2014,"state":1987,"title":2024,"updated_at":2025,"url":2026,"score":2027},"### Environment\r\n\r\n- Operating System: `Darwin`\r\n- Node Version: `v20.8.1`\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: `yarn@1.22.19`\r\n- Builder: `-`\r\n- User Config: `devtools`, `modules`\r\n- Runtime Modules: `@nuxt/test-utils/module@3.9.0`\r\n- Build Modules: `-`\r\n\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/github-gee6qy?file=app.vue\r\n\r\n### Describe the bug\r\n\r\nOnce I expose a variable called `error` within the setup, the component fails to render. \r\nSince everything works within the dev server / build, I suspect this is something within `@nuxt/test-utils`\r\n\r\nAfter renaming the `error` variable to something else, the component can be mounted within the tests again.\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n```shell-script\r\nVitest caught 1 unhandled error during the test run.\r\nThis might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\nTypeError: 'set' on proxy: trap returned falsish for property 'error'\r\n ❯ clonedComponent.render node_modules/@nuxt/test-utils/dist/runtime-utils/index.mjs:128:44\r\n 126| renderContext[key] = passedProps[key];\r\n 127| }\r\n 128| return render.call(this, renderContext, ...args);\r\n | ^\r\n 129| } : void 0,\r\n 130| setup: setup ? (props2) => wrappedSetup(props2, setupContext) : void 0\r\n ❯ renderComponentRoot node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:868:16\r\n ❯ ReactiveEffect.componentUpdateFn node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5922:46\r\n ❯ ReactiveEffect.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:174:19\r\n ❯ instance.update node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6053:16\r\n ❯ setupRenderEffect node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6063:5\r\n ❯ eval node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1613:9\r\n\r\nThis error originated in \"test/app.nuxt.test.ts\" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.\r\nThe latest test that might've caused the error is \"Should mount\". It might mean one of the following:\r\n- The error was thrown, while Vitest was running this test.\r\n- This was the last recorded test before the error was thrown, if error originated after test finished its execution.\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\n\r\n```\r\n```\r\n",[2022],{"name":2005,"color":2006},684,"mountSuspended fails: 'set' on proxy: trap returned falsish for property 'error'","2025-03-14T15:14:45Z","https://github.com/nuxt/test-utils/issues/684",0.7526815,{"description":2029,"labels":2030,"number":2038,"owner":1985,"repository":2039,"state":1987,"title":2040,"updated_at":2041,"url":2042,"score":2043},"### Environment\n\nN/A\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Version\n\nN/A\n\n### Reproduction\n\nhttps://ui.nuxt.com/components/dashboard-sidebar#control-open-state\n\n### Description\n\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2031,2032,2035],{"name":2005,"color":2006},{"name":2033,"color":2034},"documentation","0075ca",{"name":2036,"color":2037},"v3","49DCB8",3561,"ui","Cloudflare error in docs","2025-03-17T14:40:36Z","https://github.com/nuxt/ui/issues/3561",0.7634695,{"description":2045,"labels":2046,"number":2047,"owner":1985,"repository":2048,"state":1987,"title":2049,"updated_at":2050,"url":2051,"score":2052},"Hello Nuxters,\r\n\r\nI'm a fan and a supporter of nuxt and wanted to contribute in any way possible.\r\nNot sure if it is under cooking, but if not, I would be glad to add a deploy page for (Coolify.io)[https://coolify.io/]\r\n\r\nPlease let me know if that would be an acceptable pull request.\r\n\r\nThanks,\r\nMohannad",[],1609,"nuxt.com","docs: add deploy to Coolify.io","2024-07-19T06:05:15Z","https://github.com/nuxt/nuxt.com/issues/1609",0.7755452,{"description":2054,"labels":2055,"number":2057,"owner":1985,"repository":2014,"state":1987,"title":2058,"updated_at":2059,"url":2060,"score":2061},"### Environment\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.9.3\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: npm@10.2.3\r\n- Builder: -\r\n- User Config: devtools\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/github-ddvycp\r\n\r\n### Describe the bug\r\n\r\n```ts\r\nconst wrapper = await mountSuspended(OptionAPIComponent)\r\n```\r\n`wrapper.vm.$data` is empty\r\n`wrapper.setData({...data})` will result into error:\r\n```\r\nTypeError: Cannot add property, object is not extensible\r\n```\r\n\r\nFurthermore, I cannot call any method of the component instance:\r\n```\r\nTypeError: wrapper.vm.myMethod is not a function\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nComponent written in composition api doesn't have this issue.\r\n@vue/test-utils doesn't have this issue.\r\n\r\n### Logs\r\n\r\n_No response_",[2056],{"name":2011,"color":2012},735,"No data on Option API component returned by mountSuspended","2025-01-29T17:42:23Z","https://github.com/nuxt/test-utils/issues/735",0.7789353,{"description":2063,"labels":2064,"number":2069,"owner":1985,"repository":2014,"state":1987,"title":2070,"updated_at":2071,"url":2072,"score":2073},"### Environment\r\n\r\nLocal machine\r\n------------------------------\r\n- Operating System: Windows_NT\r\n- Node Version: v18.15.0\r\n- Nuxt Version: 3.7.1\r\n- CLI Version: 3.8.1\r\n- Nitro Version: 2.6.3\r\n- Package Manager: yarn@1.22.19\r\n- Builder: -\r\n- User Config: app, devtools, modules, tailwindcss, css, runtimeConfig, build\r\n- Runtime Modules: @nuxt/ui@2.12.0, @nuxtjs/tailwindcss@6.8.0, @nuxt/test-utils/module@3.9.0\r\n- Build Modules: -\r\n------------------------------\r\n\r\nStackblitz env\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: -\r\n- CLI Version: 3.10.0\r\n- Nitro Version: -\r\n- Package Manager: npm@9.4.2\r\n- Builder: -\r\n- User Config: -\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\nRepro stack blitz - https://stackblitz.com/edit/stackblitz-starters-cetpk5?file=vitest.config.js\r\n\r\n### Describe the bug\r\n\r\nWhen following testing documentation - https://nuxt.com/docs/getting-started/testing, after adding `vitest.config.{ts,js}` with `defineVitestConfig` and a basic test, `vitest run` fails with an error \r\n\r\n\u003Cdetails>\r\n\u003Csummary>Bash error.\u003C/summary>\r\n✘ [ERROR] \"@nuxt/test-utils/config\" resolved to an ESM file. ESM file cannot be loaded by `require`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps]\r\n\r\n node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68381:9:\r\n 68381 │ }\r\n ╵ ^\r\n\r\n at bundleConfigFile/setup/\u003C (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68381:35)\r\n at handlePlugins/requestCallbacks[\"on-resolve\"] (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1364:28)\r\n at handleRequest (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:722:17)\r\n at handleIncomingPacket (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:747:20)\r\n at readFromStdout (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:670:27)\r\n at EventEmitter.prototype.emit (node:events:42:9202)\r\n at addChunk (node:internal/streams/readable:105:4109)\r\n at readableAddChunk (node:internal/streams/readable:105:3816)\r\n at Readable.prototype.push (node:internal/streams/readable:105:2679)\r\n at onStreamRead (node:internal/stream_base_commons:158:2341)\r\n at _0x340f71/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:318835)\r\n at _0x241289 (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:320540)\r\n at _0x124cfc (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:317167)\r\n at _0x574284/\u003C/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319772)\r\n at _0x574284/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319750)\r\n at _0x574284 (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319784)\r\n\r\n This error came from the \"onResolve\" callback registered here:\r\n\r\n node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68345:26:\r\n 68345 │ name: 'inject-file-scope-variables',\r\n ╵ ^\r\n\r\n at setup (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68345:27)\r\n at handlePlugins (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1283:26)\r\n at buildOrContextImpl (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:969:18)\r\n at buildOrContext (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:778:23)\r\n at build/\u003C (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:2020:15)\r\n at build (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:2019:25)\r\n at build (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1853:51)\r\n at bundleConfigFile (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68306:35)\r\n at loadConfigFromFile (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68282:31)\r\n at resolveConfig (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:67884:34)\r\n at _createServer (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:60373:26)\r\n at createServer (/home/projects/stackblitz-starters-cetpk5/node_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:60370:12)\r\n at createViteServer (/home/projects/stackblitz-starters-cetpk5/node_modules/vitest/dist/vendor/node.xyYo9ZvH.js:7672:30)\r\n at createVitest (/home/projects/stackblitz-starters-cetpk5/node_modules/vitest/dist/vendor/node.xyYo9ZvH.js:8894:24)\r\n\r\n The plugin \"externalize-deps\" was triggered by this import\r\n\r\n vitest.config.js:4:35:\r\n 4 │ import { defineVitestConfig } from '@nuxt/test-utils/config'\r\n ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nfailed to load config from /home/projects/stackblitz-starters-cetpk5/vitest.config.js\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\nError: Build failed with 1 error:\r\nnode_modules/vite/dist/node/chunks/dep-V3BH7oO1.js:68381:9: ERROR: [plugin: externalize-deps] \"@nuxt/test-utils/config\" resolved to an ESM file. ESM file cannot be loaded by `require`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.\r\n at failureErrorWithLog (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1641:15)\r\n at buildResponseToResult/\u003C (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1049:44)\r\n at runOnEndCallbacks (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1476:49)\r\n at buildResponseToResult (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1047:24)\r\n at buildOrContextContinue/\u003C (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:1076:16)\r\n at sendRequest/responseCallbacks[id] (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:694:17)\r\n at handleIncomingPacket (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:754:17)\r\n at readFromStdout (/home/projects/stackblitz-starters-cetpk5/node_modules/esbuild/lib/main.js:670:27)\r\n at EventEmitter.prototype.emit (node:events:42:9202)\r\n at addChunk (node:internal/streams/readable:105:4109)\r\n at readableAddChunk (node:internal/streams/readable:105:3816)\r\n at Readable.prototype.push (node:internal/streams/readable:105:2679)\r\n at onStreamRead (node:internal/stream_base_commons:158:2341)\r\n at _0x340f71/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:318835)\r\n at _0x241289 (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:320540)\r\n at _0x124cfc (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:317167)\r\n at _0x574284/\u003C/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319772)\r\n at _0x574284/\u003C (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319750)\r\n at _0x574284 (https://stackblitzstarterscetpk5-klbu.w-corp.staticblitz.com/blitz.f7aa08df.js:350:319784) {\r\n errors: [Getter/Setter],\r\n warnings: [Getter/Setter]\r\n}\r\n\u003C/details>\r\n\r\nIf there's something im doing wrong (eg Node version, some extra setup) this should be stated in the docs\r\n\r\n### Additional context\r\n\r\nSry if dupe, couldn't find a similar issue\r\n\r\n### Logs\r\n\r\n_No response_",[2065,2066],{"name":2033,"color":2034},{"name":2067,"color":2068},"good first issue","7057ff",704,"Following documentation and using `defineVitestConfig` results in an `[ERROR] \"@nuxt/test-utils/config\" resolved to an ESM file.`","2024-04-09T17:51:51Z","https://github.com/nuxt/test-utils/issues/704",0.7791717,{"description":2075,"labels":2076,"number":2023,"owner":1985,"repository":2048,"state":2080,"title":2081,"updated_at":2082,"url":2083,"score":2027},"Blocked by #720 ",[2077],{"name":2078,"color":2079},"enhancement","1ad6ff","closed","[Community] Nuxters filter to select community only","2022-07-25T13:34:54Z","https://github.com/nuxt/nuxt.com/issues/684",{"description":2085,"labels":2086,"number":2088,"owner":1985,"repository":2014,"state":2080,"title":2089,"updated_at":2090,"url":2091,"score":2092},"I can't find a valid combination to use with Vuetify. I created an issue at `@nuxt-alt/vuetify`, where the `vite-plugin-vuetify` causes error `Vuetify plugin must be loaded after the vue plugin`:\r\n* https://github.com/nuxt-alt/vuetify/issues/9\r\n\r\nThis is caused by `vite:extendConfig` Nuxt hook not having the `vite:vue` Plugin accessible, so it can't reorder it. (Using `vite:configResolved` hook instead didn't work either.)\r\n\r\nNote that this issue only occurs when `vitest.config.mjs` is used, so I assume there may be some `nuxt-vitest`-specific zero-config Vite misconfiguration. I'd appreciate any hints about the root cause (or alternatives).",[2087],{"name":2008,"color":2009},591,"Incompatible with Vuetify","2023-12-02T00:27:10Z","https://github.com/nuxt/test-utils/issues/591",0.7544078,["Reactive",2094],{},["Set"],["ShallowReactive",2097],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"5TOOKp1k_FXfb6liRNzKcZ_7EkuU_j3_6mg3D_qKR5s":-1},"/nuxt/ui/2753"]