Javascript – Nuxt 3 useFetch data possibly null errors when using Typescript
I am using Typescript on my Vue page and trying to fetch user data from API. <script setup lang="ts"> const { data: user } = await useFetch('/api/user/info', { headers: useRequestHeaders(['cookie']) }); if (!user.value) throw createError('Problems when fetching current user!'); const…