From 762621eec092ad4d6268a91b96ea1d6e812dfa61 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Tue, 10 Sep 2024 19:25:47 +0300 Subject: [PATCH] docs: update useFetch troubleshooting section (#28918) --- docs/3.api/2.composables/use-fetch.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/3.api/2.composables/use-fetch.md b/docs/3.api/2.composables/use-fetch.md index 4ca72835f1..5471f6b66a 100644 --- a/docs/3.api/2.composables/use-fetch.md +++ b/docs/3.api/2.composables/use-fetch.md @@ -70,6 +70,10 @@ const { data, status, error, refresh, clear } = await useFetch('/api/auth/login' `useFetch` is a reserved function name transformed by the compiler, so you should not name your own function `useFetch`. :: +::warning +If you encounter the `data` variable destructured from a `useFetch` returns a string and not a JSON parsed object then make sure your component doesn't include an import statement like `import { useFetch } from '@vueuse/core`. +:: + ::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=njsGVmcWviY" target="_blank"} Watch the video from Alexander Lichter to avoid using `useFetch` the wrong way! ::