QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.82k stars 1.3k forks source link

[📖] fetch failed following joke app example in Getting Started #6750

Open ryanolson-aumni opened 3 months ago

ryanolson-aumni commented 3 months ago

Suggestion

In the joke tutorial, once I get to the place where we start using the useDadJoke signal, I see this error when trying to run it.

9:31:56 AM [vite] Internal server error: fetch failed
  File: /Users/user/r/qwik-jokes/src/routes/joke/index.tsx:5:20
  3  |   
  4  |  export const useDadJoke = routeLoader$(async () => {
  5  |    const response = await fetch('https://icanhazdadjoke.com/', {
     |                      ^
  6  |      headers: { Accept: 'application/json' },
  7  |    });

It'd be nice if the docs had everything needed to follow through with the tutorial. I was thinking about learning Qwik, but this gave me a sour taste in my mouth with the first 5 minutes of looking into Qwik. Something to think about.

wmertens commented 3 months ago

Hmm, it seems that that site had a brief issue.

Making the tutorial robust against that would mean not using fetch, which would be a shame.

Perhaps the tutorial should include error handling code, but then it becomes more complex and gets in the way of the learning :-/

ryanolson-aumni commented 3 months ago

When you say it had a brief issue, what do you mean? I still get the same error.

ryanolson-aumni commented 3 months ago

Or maybe the tutorial shouldn't depend on a 3rd party service that may or may not work. Maybe something more local.

JerryWu1234 commented 2 months ago

useDadJoke

DO you know where problem is ? maybe I can try it