\r\n\u003C/template>\r\n\r\n\u003Cscript setup lang=\"ts\">\r\nconst { data, error, pending, status, refresh } = useFetch(\r\n \"https://jsonplaceholder.typicode.com/todos/1\",\r\n { immediate: false }\r\n);\r\n\u003C/script>\r\n```\r\n\r\n...you will notice that \"pending\" will remain **true** until the request is triggered at least once.\r\n\r\n### Describe the bug\r\n\r\nMaybe it is by design, but I have the feeling pending should stay **false** while not fetching, even in not immediate mode.\r\nA workaround is to use \"status === pending\" in template loaders, but I feel it less straightforward than \"pending\".\r\n\r\n### Additional context\r\n\r\nI hope my English is understandable, and thank you for your amazing work.\r\n\r\n### Logs\r\n\r\n_No response_",[2000,2001],{"name":1985,"color":1986},{"name":1988,"color":1989},23562,"useAsyncData with { immediate: false } returns pending = \"true\" until fired at least once.","2023-10-07T11:05:38Z","https://github.com/nuxt/nuxt/issues/23562",0.59784013,{"description":2008,"labels":2009,"number":2014,"owner":1991,"repository":1991,"state":1992,"title":2015,"updated_at":2016,"url":2017,"score":2018},"### Environment\n\n------------------------------\r\n- Operating System: `Linux`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `npm@7.17.0`\r\n- Builder: `vite`\r\n- User Config: `-`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-qorbrt?file=app.vue\r\n\r\nOpen DevTool, `\u003CNuxtWelcome />` not render at server side.\n\n### Describe the bug\n\nWhen we use `useAsyncData()` and set `server: false`. the return value `pending` will get `true` at server side. It should be `false`? because this will not invoke at server side.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2010,2013],{"name":2011,"color":2012},"discussion","538de2",{"name":1985,"color":1986},15714,"`useAsyncData` return value that `pending` is `true` at server side when `server: false`","2023-02-08T02:39:02Z","https://github.com/nuxt/nuxt/issues/15714",0.61521655,{"description":2020,"labels":2021,"number":2024,"owner":1991,"repository":1991,"state":1992,"title":2025,"updated_at":2026,"url":2027,"score":2028},"### Environment\n\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v18.16.0\r\n- Nuxt Version: 3.6.2\r\n- Nitro Version: 2.5.2\r\n- Package Manager: pnpm@8.5.1\r\n- Builder: vite\r\n- User Config: ssr, pages, srcDir, routeRules, experimental, devtools, alias, typescript, css, app, modules, unocss, imports, components, vite\r\n- Runtime Modules: @pinia/nuxt@0.4.11, @vueuse/nuxt@10.2.1, @unocss/nuxt@0.53.4, @vue-macros/nuxt@1.3.12, nuxt-vitest@0.8.7\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\n- Github repo : https://github.com/ChronicStone/repro-issue-nuxt-useAsyncData\r\n- Live version : https://repro-issue-nuxt-use-async-data.vercel.app/\n\n### Describe the bug\n\nSince upgrating to v3.6.2, useAsyncData has inconsistent & strange behaviour.\r\nI found two main strange behaviours : \r\n\r\n### SCENARIO 1 : \r\n\r\nHere the data load once, but then the function that resolves it never runs again, no matter how the watch dependencies change.\r\n\r\nAlso, if I have the following route : `/users/profile/:userId()`\r\nWhen first visiting the page, the data will be resolved correctly if it's not already populated. If I come back to the route with a different ID, it won't re-trigger the resolver at all. I need to do a full page reload to have it resolve the correct data.\r\n\r\n### SCENARIO 2 : \r\n\r\nThe data does not load at first, and stays empty. Then, if a dependency change, it will refresh correctly.\r\n\r\n----\r\n\r\nThe reproduction provided includes the 2nd scenario, I couldn't reproduce the 1st case on a minimal setup yet. An other interesting is that on both case, devtools is completely bugged on these two cases, hitting refresh there won't do anything. You can also observe this in the provided minimal reproduction\n\n### Additional context\n\nFirst here's the context on which i'm using it\r\n- `ssr: false` in config\r\n- I'm not awaiting the useAsyncData on my component\r\n\r\nHere's an example of how i'm using it in-app : \r\n\r\n```ts\r\nconst periodFilters = ref\u003C{ month: number; year: number }>({ month: 1, year: 1 });\r\n\r\nconst { data, pending } = useAsyncData(\r\n \"assessmentCountStats\",\r\n () => StatisticsController.getAssessmentStatusCount(props.clientId, periodFilters.value),\r\n { watch: [() => props.clientId, () => periodFilters.value.year, () => periodFilters.value.month] }\r\n);\r\n```\r\n\r\nAlso worth mentionning that if I switch back to 3.6.1, everything works fine, data always update according to dependency & load correctly.\n\n### Logs\n\n_No response_",[2022,2023],{"name":1985,"color":1986},{"name":1988,"color":1989},22027,"useAsyncData has inconsistent behaviour (ssr:false) since v3.6.2","2023-07-11T07:02:52Z","https://github.com/nuxt/nuxt/issues/22027",0.6252119,{"description":2030,"labels":2031,"number":2034,"owner":1991,"repository":1991,"state":1992,"title":2035,"updated_at":2036,"url":2037,"score":2038},"### Environment\n\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v18.15.0\r\n- Nuxt Version: 3.5.3\r\n- Nitro Version: 2.4.1\r\n- Package Manager: npm@9.5.0\r\n- Builder: vite\r\n- User Config: app, vite, modules, css, typescript, postcss, runtimeConfig, viewport, image\r\n- Runtime Modules: @pinia/nuxt@0.4.11, @vueuse/nuxt@9.13.0, @nuxt/image-edge@1.0.0-28099902.2b6ed1c, nuxt-viewport@2.0.4, nuxt-typed-router@3.2.2, @nuxtjs/google-fonts@3.0.1\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-sbu2zi?file=pages%2Ftest.vue\n\n### Describe the bug\n\nWhen the `immediate` option is set to false on the `useFetch` composable. The `pending` value return true on initial load till the function has been executed. \r\n\r\nThe ideal behavior would be the `pending` value would be false by default when `immediate` option is set to false. \n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2032,2033],{"name":1985,"color":1986},{"name":1988,"color":1989},21581,"useFetch pending true by default when immediate set to false","2023-06-15T16:16:09Z","https://github.com/nuxt/nuxt/issues/21581",0.6260064,{"labels":2040,"number":2043,"owner":1991,"repository":1991,"state":1992,"title":2044,"updated_at":2045,"url":2046,"score":2047},[2041,2042],{"name":1985,"color":1986},{"name":1988,"color":1989},14025,"useAsyncData still returning \"pending\" true when network tab shows completed","2023-01-19T17:27:45Z","https://github.com/nuxt/nuxt/issues/14025",0.6385457,{"description":2049,"labels":2050,"number":2053,"owner":1991,"repository":1991,"state":1992,"title":2054,"updated_at":2055,"url":2056,"score":2057},"### Environment\n\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.11.2\r\n- CLI Version: 3.11.1\r\n- Nitro Version: 2.9.6\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------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-zdl7ze?file=pages%2Findex.vue\n\n### Describe the bug\n\nI'm new to Vue/Nuxt and maybe this is something really obvious but I'm seeing something that makes no sense to me:\r\n\r\n\u003Cimg width=\"515\" alt=\"image\" src=\"https://github.com/nuxt/nuxt/assets/337968/159bebd0-27df-4670-87c9-82e60236db83\">\r\n\r\nThe red container has an `v-if=\"data.pending\"` on it. My understanding is that this should mean the element is hidden when the value is false. That does not happen, I can see the `false` value rendered **inside** the element. \r\n\r\nThe code is very small:\r\n\r\n```ts\r\n\u003Cscript setup lang=\"ts\">\r\nconst data = useAsyncData('test', async () => {\r\n return 'test';\r\n});\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv style=\"background: red\" v-if=\"data.pending\">\r\n Pending is: {{ data.pending }}, Data is: {{ data.data }}\r\n \u003C/div>\r\n \u003Cdiv style=\"background: red\" v-if=\"false\">This is false\u003C/div>\r\n \u003Cdiv style=\"background: green\" v-if=\"true\">This is true\u003C/div>\r\n\u003C/template>\r\n```\n\n### Additional context\n\nThis happens locally (MacOS) and in stackblitz\n\n### Logs\n\n_No response_",[2051,2052],{"name":1985,"color":1986},{"name":1988,"color":1989},26683,"v-if does not work with useAsyncData","2024-04-07T19:34:25Z","https://github.com/nuxt/nuxt/issues/26683",0.6416811,{"labels":2059,"number":2062,"owner":1991,"repository":1991,"state":1992,"title":2063,"updated_at":2064,"url":2065,"score":2066},[2060,2061],{"name":1985,"color":1986},{"name":1988,"color":1989},13633,"useAsyncData does not update data after first load","2023-01-19T17:02:42Z","https://github.com/nuxt/nuxt/issues/13633",0.6452488,{"description":2068,"labels":2069,"number":2071,"owner":1991,"repository":1991,"state":1992,"title":2072,"updated_at":2073,"url":2074,"score":2075},"### Environment\n\n------------------------------\r\n- Operating System: Darwin\r\n- Node Version: v20.11.0\r\n- Nuxt Version: 3.11.2\r\n- CLI Version: 3.11.1\r\n- Nitro Version: 2.9.6\r\n- Package Manager: npm@10.2.4\r\n- Builder: -\r\n- User Config: srcDir, experimental, runtimeConfig, app, components, imports, devtools, typescript, modules, eslint, fontMetrics, i18n, tailwindcss, postcss, css, alias, vite, build, sourcemap, hooks\r\n- Runtime Modules: @nuxtjs/critters@0.7.1, @nuxtjs/fontaine@0.4.2, @nuxtjs/i18n@8.3.1, @nuxtjs/tailwindcss@6.12.0, @pinia/nuxt@0.5.1, @vueuse/nuxt@10.10.0, nuxt-lazy-hydrate@1.0.0, nuxt-viewport@2.1.5, @nuxt/eslint@0.3.13\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-k9azxd\r\n\r\nSteps to reproduce:\r\n1. Load index page\r\n2. Click on link \"different page\" \r\n watcher for \"status\" show states in order of \"idle -> pending -> success\" \r\n3. Click on link \"index\"\r\n4. Click on link \"differen page\"\r\n watcher for \"status\" now shows \"success -> pending -> success\"\r\n \r\nSame is for pending which is initially \"false\" on step 4. \n\n### Describe the bug\n\nOn second visit of a route with top level `useLazyAsyncData` in script setup, `status` and `pending` state seem to be incorrect. I would expect the initial state for status to be `idle` and for pending to be `true`. \r\n\r\nAs this is only the case for the second visit it might related to the caching and is intended behavior?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2070],{"name":1988,"color":1989},27552,"status of useLazyAsyncData for cached requests is success on router enter","2025-04-14T16:04:47Z","https://github.com/nuxt/nuxt/issues/27552",0.65192443,{"description":2077,"labels":2078,"number":2083,"owner":1991,"repository":1991,"state":1992,"title":2084,"updated_at":2085,"url":2086,"score":2087},"### Environment\n\n- Operating System: Windows_NT\r\n- Node Version: v18.20.3\r\n- Nuxt Version: 3.13.0\r\n- CLI Version: 3.13.1\r\n- Nitro Version: 2.9.7\r\n- Package Manager: pnpm@9.4.0\r\n- Builder: -\r\n- User Config: compatibilityDate, devtools, modules, eslint, pwa, csurf, vite, build, app, vueuse, devServer, hooks, pinia, css\r\n- Runtime Modules: @unocss/nuxt@0.62.3, @nuxtjs/device@3.2.2, @nuxt/eslint@0.5.5, @pinia/nuxt@0.5.4, @pinia-plugin-persistedstate/nuxt@1.2.1, @vueuse/nuxt@11.0.3, @vite-pwa/nu\r\nxt@0.10.3, nuxt-csurf@1.6.2, nuxt-authorization@0.0.4, nuxt-icon@0.6.10, nuxtjs-naive-ui@1.0.2\r\n- Build Modules: -\r\n\n\n### Reproduction\n\n无\n\n### Describe the bug\n\n我使用useAsyncData在服务端获取数据,且引入了 'nuxt-csurf'。\r\n如果我使用$fetch,就会触发403错误,\r\n如果我使用$csrfFetch,就返回错误,空数据,无法解析。\r\n-------------------------------------------------------------------------\r\nI use 'useAsyncData' to retrieve data on the server and introduce 'nuxt csurf'.\r\nIf I use $fetch, it will trigger a 403 error,\r\nIf I use $csrfFetch, it returns an error, empty data, and cannot be parsed.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2079,2080],{"name":1988,"color":1989},{"name":2081,"color":2082},"needs reproduction","FBCA04",29007,"useAsyncData use $csrfFetch ","2024-09-16T02:05:00Z","https://github.com/nuxt/nuxt/issues/29007",0.65286636,["Reactive",2089],{},["Set"],["ShallowReactive",2092],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"xPydD-zH1yMXm_43zjvFmbtbt2Up5FpaveXQdAv38dw":-1},"/nuxt/nuxt/19189"]