\r\n\u003C/template>\r\n\u003Cscript setup>\r\nconst show = ref(false)\r\n\u003C/script>\r\n\u003Cscript setup>\r\nconst {error, data} = await useFetch('https://ord.uib.no/bm/fil/article100new.json')\r\n\u003C/script>\r\n```\r\n\r\n\r\n#### **`app.vue`**\r\n```vue\r\n\u003Ctemplate>\r\n \u003Cbutton @click=\"show=!show\">toggle\u003C/button>\r\n \u003CPage v-if=\"show\"/>\r\n\u003C/template>\r\n\u003Cscript setup>\r\nconst show = ref(false)\r\n\u003C/script>\r\n```\r\n\r\nAfter the page has finished loading in the browser, disconnect from the internet, or select 'offline' in the browser devtools. Then click the button to render the Page-component. The error message will be \"\u003Cno response> Failed to fetch\", with status code 500.\r\n\r\n\r\n\r\n### Describe the bug\r\n\r\nWhen internet connection is lost, useFetch returns it as an internal server error when using an external API:\r\n{ \"cause\": \"TypeError: Failed to fetch\", \"message\": \"[GET] \\\"https://ord.uib.no/bm/fil/article100new.json\\\": \u003Cno response> Failed to fetch\", \"name\": \"Error\", \"statusCode\": 500 }\r\n\r\nIn the browser devtools I see an error code in fetch.js that makes more sense: net::ERR_INTERNET_DISCONNECTED, but I'm unable to capture this with useFetch.\r\n\r\n### Additional context\r\nThe error code is 500 even if SSR is disabled.\r\n\r\n### Logs\r\n\r\n_No response_",[3178,3179,3182,3185],{"name":3140,"color":3141},{"name":3180,"color":3181},"workaround available","11376d",{"name":3183,"color":3184},"upstream","E8A36D",{"name":3186,"color":3187},"🍰 p2-nice-to-have","0E8A16",24334,"Misleading error message in useFetch","2024-06-30T11:06:51Z","https://github.com/nuxt/nuxt/issues/24334",0.67345005,{"description":3194,"labels":3195,"number":3200,"owner":3146,"repository":3146,"state":3201,"title":3202,"updated_at":3203,"url":3204,"score":3205},"### Environment\n\n- Operating System: `Darwin`\r\n- Node Version: `v14.17.0`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `npm@6.14.13`\r\n- Builder: `vite`\r\n- User Config: `app`, `modules`, `googleFonts`, `tailwindcss`, `colorMode`\r\n- Runtime Modules: `@nuxtjs/tailwindcss@6.1.3`, `@nuxtjs/google-fonts@3.0.0-1`, `@nuxtjs/supabase@0.3.0`, `@nuxtjs/color-mode@3.1.8`, `@pinia/nuxt@0.4.5`, `@formkit/nuxt@1.0.0-beta.12`\r\n- Build Modules: `-`\n\n### Reproduction\n\n```\r\nconst getContact = async () => {\r\n loading.value = true;\r\n try {\r\n const { data, error } = await client\r\n .from(\"contacts\")\r\n .select()\r\n .eq(\"id\", route.params.id);\r\n if (data) {\r\n contact.value = data[0];\r\n }\r\n if (!contact.value || error) {\r\n throw error;\r\n }\r\n } catch (error) {\r\n console.log(\"Contact not found\");\r\n throw createError({\r\n statusCode: 404,\r\n statusMessage: \"Contact not found.\",\r\n fatal: true,\r\n });\r\n } finally {\r\n loading.value = false;\r\n }\r\n };\r\n getContact();\r\n\r\n```\n\n### Describe the bug\n\nthrow createError does not work inside an async function with try/catch.\r\n\r\nI can console.log or throw alert however.\r\n\r\nTerminal error:\r\n```\r\n[nitro] [dev] [unhandledRejection] H3Error: Contact not found. 11:32:37\r\n at Module.createError (file:///Users/izakjackson/Documents/GitHub/CRM/node_modules/h3/dist/index.mjs:48:15)\r\n at Module.createError (/Users/izakjackson/Documents/GitHub/CRM/node_modules/nuxt/dist/app/composables/error.mjs:35:38)\r\n at getContact (/Users/izakjackson/Documents/GitHub/CRM/pages/contacts/[id].vue:57:35)\r\n at processTicksAndRejections (internal/process/task_queues.js:95:5) {\r\n statusCode: 404,\r\n fatal: true,\r\n unhandled: false,\r\n statusMessage: 'Contact not found.',\r\n __nuxt_error: true\r\n}\r\n```\r\n\r\nConsole error:\r\n```\r\nUncaught (in promise) Error: Contact not found.\r\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3196,3199],{"name":3197,"color":3198},"3.x","29bc7f",{"name":3156,"color":3157},15754,"closed","throw createError not working in async try/catch","2023-01-19T18:20:29Z","https://github.com/nuxt/nuxt/issues/15754",0.64717,{"description":3207,"labels":3208,"number":3211,"owner":3146,"repository":3146,"state":3201,"title":3212,"updated_at":3213,"url":3214,"score":3215},"### Environment\n\n- Operating System: Windows_NT\r\n- Node Version: v16.13.1\r\n- Nuxt Version: 3.5.0-28059470.ddbb8479\r\n- Nitro Version: 2.4.1-28058956.2ef9608\r\n- Package Manager: yarn@1.22.19\r\n- Builder: vite\r\n- User Config: app, css, imports, plugins, modules, image, supabase,\r\n nitro, runtimeConfig\r\n- Runtime Modules: @nuxtjs/tailwindcss@6.6.7, @nuxt/image-edge@1.0.0-28059208.2abef1b, @nuxtjs/supabase@0.3.5, @pinia-plugin-persistedstate/nuxt@1.1.1, @pinia/nuxt@0.4.10\n\n### Reproduction\n\nI don have link\n\n### Describe the bug\n\nI have the index.vue page with the following code:\r\n\r\n```\r\n\u003Cscript setup>\r\nconst { pending: pendingProject, data: projectData } = await useLazyFetch('/api/projects/latest')\r\n\r\nconsole.log('projectData', projectData.value)\r\n\r\nwatch(() => pendingProject, (newVulue) => {\r\n \r\n if (!newVulue.value) {\r\n setTimeout(() => {\r\n\r\n if (process.client) projectScrollMagic()\r\n }, 800)\r\n }\r\n}, { immediate: true })\r\n\u003C/script>\r\n```\r\n\r\n and this method is executed when I come from any page (except the one I need which is the error.page). If the user is on the page and I send him to the index, using router.push, router.replace, clearError, when accessing the index.vue the useLazyFetch is not executed and the projectData is null\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3209,3210],{"name":3197,"color":3198},{"name":3156,"color":3157},20767,"Coming from the error page fetch does not work","2023-05-10T22:09:58Z","https://github.com/nuxt/nuxt/issues/20767",0.65657383,{"description":3217,"labels":3218,"number":3224,"owner":3146,"repository":3146,"state":3201,"title":3225,"updated_at":3226,"url":3227,"score":3228},"### Environment\n\n- Operating System: `Darwin`\r\n- Node Version: `v18.12.0`\r\n- Nuxt Version: `3.2.3`\r\n- Nitro Version: `2.2.3`\r\n- Package Manager: `npm@9.4.2`\r\n- Builder: `vite`\r\n- User Config: `imports`, `components`, `runtimeConfig`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\n\n### Reproduction\n\nx\n\n### Describe the bug\n\nSorry for my english,\r\nI have a wrapper over $fetch in which I catch a 401 error and try to request a new token and repeat the original request\r\n\r\n\u003Cimg width=\"1017\" alt=\"image\" src=\"https://user-images.githubusercontent.com/26843077/224509954-6c5cdc5d-47c6-4b9f-8ead-242e11b7a7f3.png\">\r\n\r\nbut when I call the http function again in the catch I get a nuxt instance unavailable error\r\n\r\n\u003Cimg width=\"895\" alt=\"image\" src=\"https://user-images.githubusercontent.com/26843077/224510220-f611d25f-389b-4c5b-8978-eeb132e90afd.png\">\r\n\r\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3219,3220,3221],{"name":3197,"color":3198},{"name":3156,"color":3157},{"name":3222,"color":3223},"needs reproduction","FBCA04",19603,"Nuxt instance unavailable","2023-03-11T22:10:07Z","https://github.com/nuxt/nuxt/issues/19603",0.66227174,{"labels":3230,"number":3238,"owner":3146,"repository":3146,"state":3201,"title":3239,"updated_at":3240,"url":3241,"score":3242},[3231,3234,3235],{"name":3232,"color":3233},"stale","ffffff",{"name":3156,"color":3157},{"name":3236,"color":3237},"2.x","d4c5f9",8231,"errorCaptured not catching error throwed in fetch hook","2023-01-22T15:38:17Z","https://github.com/nuxt/nuxt/issues/8231",0.66240823,{"description":3244,"labels":3245,"number":3248,"owner":3146,"repository":3146,"state":3201,"title":3249,"updated_at":3250,"url":3251,"score":3252},"### Environment\r\n\r\n- Operating System: `Darwin`\r\n- Node Version: `v18.17.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: `bun@1.1.4`\r\n- Builder: `-`\r\n- User Config: `devtools`, `alias`, `app`, `runtimeConfig`, `css`, `build`, `modules`, `experimental`, `features`, `vite`, `nitro`\r\n- Runtime Modules: `@pinia/nuxt@0.4.11`\r\n- Build Modules: `-`\r\n\r\n\r\n### Reproduction\r\n\r\n-\r\n\r\n### Describe the bug\r\n\r\nI have a $fetch that checks inside an api route a recaptcha response:\r\n\r\n````\r\n const r = await $fetch\u003C{\r\n success: boolean\r\n hostname?: string\r\n 'error-codes'?: string[]\r\n }>('https://www.google.com/recaptcha/api/siteverify', {\r\n method: 'post',\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded'\r\n },\r\n body: new URLSearchParams({\r\n secret: captchaKey.re,\r\n response: val\r\n })\r\n });\r\n````\r\n\r\nFor some reason the build in my ssh server gets:\r\n\r\n```\r\nApi error: FetchError: [POST] \"https://www.google.com/recaptcha/api/siteverify\": \u003Cno response> fetch failed\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at r (file:///var/www/server/index.mjs:1:59455)\r\n ... 5 lines matching cause stack trace ...\r\n at Object.handler (file:///var/www/server/index.mjs:1:51201)\r\n at Server.\u003Canonymous> (file:///var/www/server/index.mjs:1:54023) {\r\n [cause]: TypeError: fetch failed\r\n at Object.fetch (node:internal/deps/undici/undici:11730:11)\r\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n at $fetchRaw (file:///var/www/server/index.mjs:1:58493)\r\n at r (file:///var/www/server/index.mjs:1:59455)\r\n at Object.refinement (file:///var/www/server/utils/zod.ts:264:1)\r\n at file:///var/www/server/node_modules/zod-abort-failed/lib/index.mjs:1971:39\r\n at ZodObject.safeParseAsync (file:///var/www/server/node_modules/zod-abort-failed/lib/index.mjs:655:24)\r\n at ZodObject.password (file:///var/www/server/node_modules/zod-abort-failed/lib/index.mjs:628:24)\r\n at Object.handler (file:///var/www/server/api/auth/index.post.ts:17:1)\r\n at Object.handler (file:///var/www/server/index.mjs:1:51201) {\r\n cause: ConnectTimeoutError: Connect Timeout Error\r\n at onConnectTimeout (node:internal/deps/undici/undici:6869:28)\r\n at node:internal/deps/undici/undici:6825:50\r\n at Immediate._onImmediate (node:internal/deps/undici/undici:6857:13)\r\n at processImmediate (node:internal/timers:476:21) {\r\n code: 'UND_ERR_CONNECT_TIMEOUT'\r\n }\r\n }\r\n} undefined undefined\r\n```\r\nI did the same request with curl and has no problem so I guess is some package issue...\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[3246,3247],{"name":3197,"color":3198},{"name":3156,"color":3157},26883,"TypeError: fetch failed","2025-05-18T10:25:50Z","https://github.com/nuxt/nuxt/issues/26883",0.66329104,{"description":3254,"labels":3255,"number":3258,"owner":3146,"repository":3146,"state":3201,"title":3259,"updated_at":3260,"url":3261,"score":3262},"### Environment\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.10.3\r\n- CLI Version: 3.10.1\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\r\n### Reproduction\r\n\r\nNuxt 3 https://stackblitz.com/edit/github-ddpyg6-tnnjef\r\nNuxt 2 https://stackblitz.com/edit/github-qzm4pm-1rxdu9\r\n\r\n### Describe the bug\r\n\r\nIn Nuxt2 when I want to use `_.vue` and try to reach some empty file then I get 404 with `cache-control: no-cache,no-store,must-revalidate` and empty result.\r\nFor example `/test.js`\r\n\r\nIn Nuxt3, in the same situation, I use `[...slug]` and when I try to get `/test.js` then it is catched by `[...slug]` and returns 200.\r\n\r\nIs this a normal behavior? Is there a config to have same result as is in Nuxt2?\r\n\r\n### Additional context\r\nNuxt2\r\n\r\n\r\nNuxt3\r\n\r\n\r\n\r\n### Logs\r\n\r\n_No response_",[3256,3257],{"name":3197,"color":3198},{"name":3156,"color":3157},25962,"\"Catch-all Route\" catch .js file","2024-02-27T07:33:52Z","https://github.com/nuxt/nuxt/issues/25962",0.66396177,["Reactive",3264],{},["Set"],["ShallowReactive",3267],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fDNDUSYSoVfoer_MM0_WeEe1rnsJHeVRC74IAbgxMZ3o":-1},"/nuxt/nuxt/15077"]