` with `\u003CNuxtPage />`\r\n3. create a file `pages/index.vue`\r\n4. create a useAsyncData call:\r\n\r\n```\r\nconst { data, error } = await useAsyncData('test', async () => {\r\n if (process.server) {\r\n console.log('Server: hi');\r\n } else if (process.client) {\r\n console.log('Client: hi');\r\n }\r\n const response = await $fetch('/api/test')\r\n});\r\n```\r\n\r\n5. create a file `server/api/test.get.ts` with this code:\r\n\r\n```\r\nexport default defineEventHandler(async event => {\r\n console.log('test.get.ts hit')\r\n});\r\n```\r\n\r\n6. `npm run dev` and each time you refresh the page, the console log in terminal will show \r\n\r\n```\r\nServer: hi\r\ntest.get.ts hit\r\ntest.get.ts hit\r\n```\r\n\r\nI've tested this on my main project with a api endpoint that adds a row to the database, and it is adding two rows every refresh. \r\n\r\nI think the problem is that useAsyncData is running the full function both on server and client. It should not be re-fetching the data on client.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[1984,1987],{"name":1985,"color":1986},"3.x","29bc7f",{"name":1988,"color":1989},"pending triage","E99695",26049,"nuxt","closed","useAsyncData is running twice refetching data (server and client)","2024-03-03T08:53:17Z","https://github.com/nuxt/nuxt/issues/26049",0.60357565,{"labels":1998,"number":2003,"owner":1991,"repository":1991,"state":1992,"title":2004,"updated_at":2005,"url":2006,"score":2007},[1999,2000],{"name":1985,"color":1986},{"name":2001,"color":2002},"bug","d73a4a",12690,"useAsyncData fetching data in both server and client on Reload. ","2023-01-19T16:09:49Z","https://github.com/nuxt/nuxt/issues/12690",0.6140489,{"description":2009,"labels":2010,"number":2015,"owner":1991,"repository":1991,"state":1992,"title":2016,"updated_at":2017,"url":2018,"score":2019},"\u003C!-- 💚 Thanks for your time to make Nuxt better with your feedbacks 💚\r\n\r\n**IMPORTANT** Before reporting a bug:\r\n\r\n- Please make sure that you have read through Nuxt documentation: https://nuxtjs.org\r\n- If issue is related to a module please create the issue in corresponding repository\r\n- Ensure using latest version of nuxt dependencies using `yarn upgrade nuxt` or `npm upgrade nuxt`\r\n\r\n👍 A properly detailed bug report can save a LOT of time and help fixing issues as soon as possible.\r\n-->\r\n\r\nHi, I just realized that `asyncData` and `nuxtServerInit` was called twice (two time for asyncData and two time for nuxtServerInit).\r\nI tried on nuxt v2.14.6 and nuxt 2.14.11 (latest) but no luck.\r\nI was successful to reproduce this behaviour on new `create nuxt app` created by command `npx create-nuxt-app new-nuxt`.\r\nYou can check it on my reproduce repository below.\r\n\r\n**Additional**: I tried both dev run and production build.\r\n\r\n\r\n### Versions\r\n\r\n- nuxt: tried 2.14.6 and 2.14.11 \u003C!-- ex: v2.13.0 -->\r\n- node: v12.14.0\r\n\r\n### Reproduction\r\nReproduce repo: https://github.com/bahung1221/nuxt-bug-reproduce\r\n\r\n\u003C!--\r\nLink to a minimal test case based on one of:\r\n- A fork of https://template.nuxtjs.org\r\n- A GitHub repository that can reproduce the bug\r\nWithout a reproduction, it is so hard to address problem :(\r\n-->\r\n\r\n\u003Cdetails open>\r\n\u003Csummary>Additional Details\u003C/summary>\r\n\u003Cbr>\r\n\u003C!-- Attaching `nuxt.config`, dependencies, logs or code snippets would help to find the issue -->\r\n\u003C/details>\r\n\r\n### Steps to reproduce\r\n- `npx create-nuxt-app new-nuxt`.\r\n- Add asyncData to `pages/index.vue`.\r\n- Try to console log anything.\r\n\r\n### What is Expected?\r\n`nuxtServerInit` should be called only one for each request, I normally get user data from API server through nuxtServerInit so it doesn't necessary to get the same data two times for each page load.\r\n\r\n### What is actually happening?\r\n`nuxtServerInit` and `asyncData` was called twice.\r\n",[2011,2012],{"name":1988,"color":1989},{"name":2013,"color":2014},"2.x","d4c5f9",8491,"both nuxtServerInit and asyncData was called twice","2023-01-22T15:38:24Z","https://github.com/nuxt/nuxt/issues/8491",0.62126374,{"description":2021,"labels":2022,"number":2030,"owner":1991,"repository":1991,"state":1992,"title":2031,"updated_at":2032,"url":2033,"score":2034},"### Environment\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.16.1\r\n- Nuxt Version: 3.6.1\r\n- Nitro Version: 2.5.2\r\n- Package Manager: yarn@1.22.19\r\n- Builder: vite\r\n- User Config: runtimeConfig, alias, css, components, vite, dir, plugins, modules, pwa\r\n- Runtime Modules: nuxt-jsonld@2.0.8, @vite-pwa/nuxt@0.1.0, @pinia/nuxt@0.4.11, @nuxtjs/eslint-module@4.1.0\r\n- Build Modules: -\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/github-tex5o8?file=pages%2Findex.vue\r\n\r\n### Describe the bug\r\n\r\nI've checked docs and as I see `useAsyncData` should cache data for response with same key.\r\n\r\nSo for example:\r\n```\r\nconst KEY = 'test';\r\nconst { data: data } = await useAsyncData(KEY, async () => {\r\n console.log('test');\r\n return {};\r\n});\r\nconst { data: data2 } = await useAsyncData(KEY, async () => {\r\n console.log('test');\r\n return {};\r\n});\r\nconst { data: data3 } = await useAsyncData(KEY, async () => {\r\n console.log('test');\r\n return {};\r\n});\r\n```\r\n\r\nThis should show only once `'test'` in console, but it shows it three times.\r\n\r\nIn real world app I need to fetch data in component A and then use same data in page B.\r\nRight now the only option that I see is to make two api calls.\r\n\r\nIn nuxt 2, I've used `fetch` component option method to make call in component A and I didn't even need to make call in page B, because I've already had data in vuex (from component A). How to handle that (without duplicated requests) if `useAsyncData` doesn't provide cache?\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2023,2026,2029],{"name":2024,"color":2025},"documentation","5319e7",{"name":2027,"color":2028},"good first issue","fbca04",{"name":1985,"color":1986},22622,"Clarify that `useAsyncData` results are not cached","2023-12-14T11:09:24Z","https://github.com/nuxt/nuxt/issues/22622",0.62403774,{"description":2036,"labels":2037,"number":2042,"owner":1991,"repository":1991,"state":1992,"title":2043,"updated_at":2044,"url":2045,"score":2046},"### 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_",[2038,2041],{"name":2039,"color":2040},"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.6254871,{"description":2048,"labels":2049,"number":2052,"owner":1991,"repository":1991,"state":1992,"title":2053,"updated_at":2054,"url":2055,"score":2056},"### 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_",[2050,2051],{"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.6276166,{"description":2058,"labels":2059,"number":2062,"owner":1991,"repository":1991,"state":1992,"title":2063,"updated_at":2064,"url":2065,"score":2066},"### Environment\r\n\r\n- Operating System: Darwin\r\n- Node Version: v20.2.0\r\n- Nuxt Version: 3.12.1\r\n- CLI Version: 3.12.0\r\n- Nitro Version: 2.9.6\r\n- Package Manager: pnpm@9.3.0\r\n- Builder: -\r\n- User Config: -\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n\r\n### Reproduction\r\n\r\n[Codesandbox link](https://codesandbox.io/p/devbox/asyncdata-deduplication-bug-2ywm5w?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clxdgf65800073b6jeonz2s2q%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clxdgf65800023b6j09sj83ci%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clxdgf65800043b6jiezwwyiw%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clxdgf65800063b6ju6e6pzsm%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clxdgf65800023b6j09sj83ci%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxdgf65700013b6jbkfgrlj5%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clxdgf65800023b6j09sj83ci%2522%252C%2522activeTabId%2522%253A%2522clxdgf65700013b6jbkfgrlj5%2522%257D%252C%2522clxdgf65800063b6ju6e6pzsm%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxdgf65800053b6j3f7t5aal%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A3000%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clxdgf65800063b6ju6e6pzsm%2522%252C%2522activeTabId%2522%253A%2522clxdgf65800053b6j3f7t5aal%2522%257D%252C%2522clxdgf65800043b6jiezwwyiw%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clxdgf65800033b6jovogrjn0%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clxdgf65800043b6jiezwwyiw%2522%252C%2522activeTabId%2522%253A%2522clxdgf65800033b6jovogrjn0%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D)\r\n\r\n- reload page\r\n- view server logs, `callback log` message should be printed\r\n- view client logs, `callback log` message should not be printed, but it is printed\r\n\r\n### Describe the bug\r\n\r\nWhen useAsyncData callback returns any falsy value(undefined, null, 0, false) that causes callback to execute both server and client side when only server side is expected\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2060,2061],{"name":1985,"color":1986},{"name":1988,"color":1989},27594,"useAsyncData unexpected behaviour when callback return falsy value","2024-11-13T17:05:30Z","https://github.com/nuxt/nuxt/issues/27594",0.6310197,{"description":2068,"labels":2069,"number":2072,"owner":1991,"repository":1991,"state":1992,"title":2073,"updated_at":2074,"url":2075,"score":2076},"### Environment\n\n```\r\n------------------------------\r\n- Operating System: `Darwin`\r\n- Node Version: `v14.21.1`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `npm@6.14.17`\r\n- Builder: `vite`\r\n- User Config: `modules`, `apollo`, `app`, `css`\r\n- Runtime Modules: `@nuxtjs/apollo@5.0.0-alpha.4`\r\n- Build Modules: `-`\r\n------------------------------\r\n```\n\n### Reproduction\n\n`/pages/test.vue`\r\n```vue\r\n\u003Ctemplate>\r\n \u003CNuxtLink to=\"/testAsync\">GO\u003C/NuxtLink>\r\n\u003C/template>\r\n```\r\n\r\n`/pages/testAsync.vue`\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\n import useTestAsync from '~~/composables/testAsync';\r\n const {data, error} = await useTestAsync();\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv>DATA: \"{{ data }}\"\u003C/div>\r\n \u003Cdiv>ERR: \"{{ error }}\"\u003C/div>\r\n\u003C/template>\r\n```\r\n\r\n`/composables/testAsync.ts`\r\n```ts\r\nexport default async function useTestAsync() {\r\n return useAsyncData(async () => {\r\n const {data: a} = await useAsyncData\u003Cnumber>('k1', async () => Math.random());\r\n const {data: b} = await useAsyncData\u003Cnumber>('k2', async () => Math.random());\r\n\r\n return ((a.value || -1) + (b.value || -1));\r\n });\r\n}\r\n```\r\n\r\n1. Go to `/test`\r\n2. Click on the \"GO\" link\r\n3. Notice that the \"DATA: \u003Crandom>\" is filled with a random num\r\n4. Refresh the page (to render this page on the server)\r\n5. Notice that the \"DATA\" is empty and the \"ERROR\" says, `\"ERR: \"Error: nuxt instance unavailable\"`\n\n### Describe the bug\n\nThe code above returns an error `Error: nuxt instance unavailable` on the server but works as expected on dynamic navigation to this page on the client.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2070,2071],{"name":1985,"color":1986},{"name":1988,"color":1989},15596,"Nested \"useAsyncData\" fails on SSR and works on the client","2023-04-17T08:39:04Z","https://github.com/nuxt/nuxt/issues/15596",0.6330602,{"labels":2078,"number":2081,"owner":1991,"repository":1991,"state":1992,"title":2082,"updated_at":2083,"url":2084,"score":2085},[2079,2080],{"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.634064,{"description":2087,"labels":2088,"number":2091,"owner":1991,"repository":2092,"state":1992,"title":2093,"updated_at":2094,"url":2095,"score":2096},"When using `useAsyncData`, the http call is made on server and on client.",[2089],{"name":2001,"color":2090},"ff281a",44,"nuxt.com","[Nuxt3] Async data called twice","2023-01-19T16:58:58Z","https://github.com/nuxt/nuxt.com/issues/44",0.6358668,["Reactive",2098],{},["Set"],["ShallowReactive",2101],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"Y7DBFqpZEtNhH0RZOtuMB8q3SkTxdHyzkj427kY5JnI":-1},"/nuxt/nuxt/13460"]