question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on using useFetch

See original GitHub issue

Environment

  • Operating System: Windows_NT
  • Node Version: v14.16.0
  • Nuxt Version: 3-3.0.0-27234211.2a0afbd
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Describe the bug and expected behavior

error on using the useFetch composable

image

index.vue

<script setup lang="ts">
import { useFetch } from "nuxt3";

const { data } = await useFetch("https://jsonplaceholder.typicode.com/posts");
console.log(data);
</script>

<template>
    <div>index</div>
</template>

<style scoped></style>

Steps to reproduce

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zynth17commented, Oct 13, 2021

But it works fine for me 🙈 Can you please help to reproduce by forking this: https://stackblitz.com/edit/github-qyxign?file=pages%2Findex.vue

i fix it by reinstalling the node_modules. that’s so weird 🤔🤔

0reactions
Adham2023commented, Jul 23, 2022

Not working with my api, which is hosted in Heroku 😭

Read more comments on GitHub >

github_iconTop Results From Across the Web

useFetch
Runs when the request get's an error. If retrying, it is only called on the last retry attempt. empty function. onNewData, Merges the...
Read more >
Handling errors on nuxt3 usefetch - vue.js - Stack Overflow
On error itself it returns ref with _error that contains object with errors. However I cannot get to those errors anyhow.. vue.js ·...
Read more >
Handling errors with useFetch : r/Nuxt - Reddit
Hi, I'm trying starting to mess around with useFetch, and I can't understand how you handle errors with it. Code:
Read more >
How to fetch data in React (with error handling) - LinkPe
This guide explains how you can fetch data in React, step by step. Check out some popular tools you can use in React...
Read more >
useFetch - Raycast API
useFetch. Hook which fetches the URL and returns the AsyncState corresponding ... By default, it will log the error and show a generic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found