From 8cbfd9d36fe65ea1aa65498e131e897948c25af0 Mon Sep 17 00:00:00 2001 From: mymx2 <32814920+mymx2@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:56:37 +0800 Subject: [PATCH] fix(useFetch): clone 'Response' on reading (#3607) (#3608) Co-authored-by: Anthony Fu --- packages/core/useFetch/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/useFetch/index.ts b/packages/core/useFetch/index.ts index 6dde796daed..06458cb1b69 100644 --- a/packages/core/useFetch/index.ts +++ b/packages/core/useFetch/index.ts @@ -469,7 +469,7 @@ export function useFetch(url: MaybeRefOrGetter, ...args: any[]): UseF response.value = fetchResponse statusCode.value = fetchResponse.status - responseData = await fetchResponse[config.type]() + responseData = await fetchResponse.clone()[config.type]() // see: https://www.tjvantoll.com/2015/09/13/fetch-and-errors/ if (!fetchResponse.ok) {