\n \u003C/NuxtLayout>\n \u003C/UApp>\n\u003C/template>\n\u003Cscript setup lang=\"ts\">\nimport { fr, en } from '@nuxt/ui/locale';\nconst locales = { fr, en };\nconst { t, locale } = useI18n();\n\u003C/script>\n```\nAnalyze your bundle:\n`npx nuxi analyze`\n\n### Description\n\nAs you can see, unused locales are still included in the bundle, while only Fr and En have been imported\n\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2909,2912],{"name":2910,"color":2911},"bug","d73a4a",{"name":2913,"color":2914},"v3","49DCB8",3602,"ui","i18n, Unused locales are included in the bundle","2025-03-18T14:19:38Z","https://github.com/nuxt/ui/issues/3602",0.63540703,{"description":2922,"labels":2923,"number":2926,"owner":2866,"repository":2927,"state":2901,"title":2928,"updated_at":2929,"url":2930,"score":2931},"\n",[2924],{"name":2910,"color":2925},"ff281a",522,"nuxt.com","Checkboxes broken on dark mode","2022-05-23T15:16:45Z","https://github.com/nuxt/nuxt.com/issues/522",0.67663306,{"description":2933,"labels":2934,"number":2926,"owner":2866,"repository":2880,"state":2901,"title":2939,"updated_at":2940,"url":2941,"score":2931},"Hey I was using `mockNuxtImport` to mock 2 different users from a nuxt composable in the same test file. It seems to use the last `mockNuxtImport` that is called in the file, not the one scoped to the test.\r\n\r\n```ts\r\nit('renders the users email', () => {\r\n\tmockNuxtImport('useSupabaseUser', () => {\r\n\t\treturn () => mockUser\r\n\t})\r\n\r\n\trender(User)\r\n\r\n\texpect(screen.getByText('jdoe@gmail.com')).toBeInTheDocument()\r\n})\r\n\r\nit('renders the Error when there is no user', () => {\r\n\tmockNuxtImport('useSupabaseUser', () => {\r\n\t\treturn () => {}\r\n\t})\r\n\r\n\trender(User)\r\n\r\n\texpect(screen.getByText('Error')).toBeInTheDocument()\r\n})\r\n```\r\n\r\nThe first test fails here as it thinks `useSupabaseUser` returns {}\r\n\r\nI did manage to get this working with a global variable:\r\n\r\n```ts\r\nlet mockUser = { id: 1, name: 'John Doe', email: 'jdoe@gmail.com' }\r\n\r\nmockNuxtImport('useSupabaseUser', () => {\r\n\treturn () => mockUser\r\n})\r\n\r\nit('renders the users email', () => {\r\n\trender(User)\r\n\r\n\texpect(screen.getByText('jdoe@gmail.com')).toBeInTheDocument()\r\n})\r\n\r\nit('renders the Error when there is no user', () => {\r\n\tmockUser = {}\r\n\r\n\trender(User)\r\n\r\n\texpect(screen.getByText('Error')).toBeInTheDocument()\r\n})\r\n```\r\n\r\nNot really sure if this is expected, it seems a little strange to me, so figured I post my findings.",[2935,2938],{"name":2936,"color":2937},"documentation","0075ca",{"name":2877,"color":2878},"Mocking multiple iterations of nuxt imports in the same test file","2024-01-24T12:25:29Z","https://github.com/nuxt/test-utils/issues/522",{"description":2943,"labels":2944,"number":2949,"owner":2866,"repository":2866,"state":2901,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### Environment\r\n\r\nNuxt project info: 10:45:42\r\n\r\n------------------------------\r\n- Operating System: Windows_NT\r\n- Node Version: v16.15.1\r\n- Nuxt Version: 3.6.1\r\n- Nitro Version: 2.5.2\r\n- Package Manager: npm@8.11.0\r\n- Builder: vite\r\n- User Config: pages\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n\r\n### Reproduction\r\n\r\n```javascript\r\n\u003Cscript setup>\r\n/**\r\n * 请求api接口\r\n * @returns {Promise\u003Cany>}\r\n */\r\nconst getData = async () => {\r\n const { data, pending, error, refresh } = await useFetch('/api/test', {\r\n onResponse({ request, response, options }) {\r\n // 处理响应数据\r\n // localStorage.setItem('token', response._data.token)\r\n console.log(\"响应成功数据:\", response);\r\n }\r\n })\r\n\r\n console.log(\"data:\", data);\r\n}\r\n\r\nonMounted(() => {\r\n getData()\r\n})\r\n\u003C/script>\r\n\r\n```\r\n\r\n### Describe the bug\r\n\r\n### 标题:在 Nuxt 3.0 中,useFetch 的 onResponse 在 onMounted 中无法被执行\r\n\r\n### 描述:\r\n\r\n在我使用 Nuxt 3.0 的 useFetch 功能时,我发现了一个问题。如果我在 onMounted 的生命周期钩子中调用 useFetch,onResponse 似乎无法获取结果,或者说 onResponse 方法没有被执行。然而,如果我直接在 setup 中调用 useFetch,onResponse 就会被执行。这是我的代码:\r\n\r\n```javascript\r\n\u003Cscript setup>\r\n/**\r\n * 请求api接口\r\n * @returns {Promise\u003Cany>}\r\n */\r\nconst getData = async () => {\r\n const { data, pending, error, refresh } = await useFetch('/api/test', {\r\n onResponse({ request, response, options }) {\r\n // 处理响应数据\r\n // localStorage.setItem('token', response._data.token)\r\n console.log(\"响应成功数据:\", response);\r\n }\r\n })\r\n\r\n console.log(\"data:\", data);\r\n}\r\n\r\nonMounted(() => {\r\n getData()\r\n})\r\n\u003C/script>\r\n```\r\n### 重现步骤:\r\n\r\n1. 创建一个新的 Nuxt 3.0 项目。\r\n2. 在 onMounted 的生命周期钩子中调用 useFetch。\r\n3. 观察控制台,无法看到 \"响应成功数据\" 的日志输出。\r\n\r\n**期望的行为:**\r\nonResponse 在 onMounted 中被正确执行,并在控制台输出 \"响应成功数据\"。\r\n\r\n**实际的行为:**\r\nonResponse 在 onMounted 中没有被执行。\r\n\r\n**环境信息:**\r\nNuxt.js 版本:3.0\r\n浏览器版本:Firefox 116.0.3 (64 位)\r\n操作系统:Windows 11\r\nNode.js 版本:16.15.1\r\n\r\n**附加信息:**\r\n我尝试在 setup 中直接调用 useFetch,这时 onResponse 可以被正确执行。\r\n\r\n\r\n\r\n*****\r\n\r\n\r\n\r\n\r\n### Title: In Nuxt 3.0, useFetch's onResponse is not executed in onMounted\r\n\r\n### Description:\r\n\r\nWhile using the useFetch feature in Nuxt 3.0, I encountered a problem. If I call useFetch in the onMounted lifecycle hook, onResponse seems unable to obtain a result, or in other words, the onResponse method is not executed. However, if I call useFetch directly in setup, onResponse is executed. Here is my code:\r\n\r\n```javascript\r\n\u003Cscript setup>\r\n/**\r\n * Request API interface\r\n * @returns {Promise\u003Cany>}\r\n */\r\nconst getData = async () => {\r\n const { data, pending, error, refresh } = await useFetch('/api/test', {\r\n onResponse({ request, response, options }) {\r\n // Processing response data\r\n // localStorage.setItem('token', response._data.token)\r\n console.log(\"Successful response data:\", response);\r\n }\r\n })\r\n\r\n console.log(\"data:\", data);\r\n}\r\n\r\nonMounted(() => {\r\n getData()\r\n})\r\n\u003C/script>\r\n```\r\n### Steps to reproduce:\r\nCreate a new Nuxt 3.0 project.\r\nCall useFetch in the onMounted lifecycle hook.\r\nObserve the console, the \"Successful response data\" log output is not visible.\r\n\r\n### Expected behavior:\r\nonResponse is correctly executed in onMounted, and \"Successful response data\" is output to the console.\r\n\r\n### Actual behavior:\r\nonResponse is not executed in onMounted.\r\n\r\n### Environment Information:\r\nNuxt.js version: 3.0\r\nBrowser version: Firefox 116.0.3 (64-bit)\r\nOperating System: Windows 11\r\nNode.js version: 16.15.1\r\n\r\n### Additional Information:\r\nWhen I try to call useFetch directly in setup, onResponse is correctly executed.\r\n\r\n### Additional context\r\n\r\n完整代码如下(The complete code is as follows):\r\n``` vue\r\n\u003C!-- index.vue -->\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n \u003Ch1>欢迎来到我的首页\u003C/h1>\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\n/**\r\n * 请求api接口\r\n * @returns {Promise\u003Cany>}\r\n */\r\nconst getData = async () => {\r\n const { data, pending, error, refresh } = await useFetch('/api/test', {\r\n onResponse({ request, response, options }) {\r\n // 处理响应数据\r\n // localStorage.setItem('token', response._data.token)\r\n console.log(\"响应成功数据:\", response);\r\n }\r\n })\r\n\r\n console.log(\"data:\", data);\r\n}\r\n\r\nonMounted(() => {\r\n getData()\r\n})\r\n\r\n\r\n\u003C/script>\r\n\r\n\u003Cstyle scoped>\u003C/style> \r\n``` \r\n\r\n\r\n### Logs\r\n\r\n_No response_",[2945,2948],{"name":2946,"color":2947},"3.x","29bc7f",{"name":2889,"color":2890},22688,"在 Nuxt 3.0 中,useFetch 的 onResponse 在 onMounted 中无法被执行","2023-12-29T08:03:51Z","https://github.com/nuxt/nuxt/issues/22688",0.67971367,{"description":2955,"labels":2956,"number":2958,"owner":2866,"repository":2866,"state":2901,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.13.0`\n- Nuxt Version: `3.16.0`\n- CLI Version: `3.23.0`\n- Nitro Version: `2.11.6`\n- Package Manager: `pnpm@9.15.4`\n- Builder: `-`\n- User Config: `compatibilityDate`, `devtools`\n- Runtime Modules: `-`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-thrqeevv?file=server%2Fapi%2Furi%2Findex.post.ts\n\n### Describe the bug\n\nI noticed an inconsistency in the blocking behavior of `useFetch` when the method is set to `POST`, where if the user is navigating to a page which uses the same component, the data change is rendered before the suspense of the new page resolves.\n\nIn the provided example, I have 2 `useFetch` calls inside `await Promise.all`. The expected behavior would be that the data on the page visually changes only after both of the promises are resolved - just like when you're navigating from `index.vue` to any of the pages in `dynamic/[uri].vue`.\nHowever, this is not the case when going from `dynamic/[uri].vue` to `dynamic/[uri].vue`.\n\nI suppose this is because we don't include the `body` of the request in the hash for the payload key and thus, the key is the same for both the old & the new request, which updates the data that's currently being rendered on the page.\nhttps://github.com/nuxt/nuxt/blob/f6bbb8e87c0d48b5e45d959715b1f119be75635a/packages/nuxt/src/app/composables/fetch.ts#L248\n\nWould this be an ok fix, or can you see any problems with that?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2957],{"name":2889,"color":2890},31428,"Inconsistent blocking behavior of `useFetch` when the method is `POST`","2025-03-24T23:20:41Z","https://github.com/nuxt/nuxt/issues/31428",0.6810978,{"description":2964,"labels":2965,"number":2969,"owner":2866,"repository":2927,"state":2901,"title":2970,"updated_at":2971,"url":2972,"score":2973},"We should discuss what to show in that video, maybe a teasing video for the moment ?",[2966],{"name":2967,"color":2968},"design","00bd6f",630,"[Projects] Video","2022-10-03T11:03:26Z","https://github.com/nuxt/nuxt.com/issues/630",0.68271226,["Reactive",2975],{},["Set"],["ShallowReactive",2978],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f6K47DQ84VI9nsf49S37-TkeoOv0X8b962TqQcS7D99E":-1},"/nuxt/nuxt.com/611"]