Ah, I ran into this last month! My API was responding just fine, but I still got the dreaded TypeError: Failed to fetch.
It turned out my server wasn’t returning Access-Control-Allow-Credentials: true while I was using credentials: “include” in the fetch request.
Once I added that header on the server side, the error disappeared instantly.
So yeah, it’s not always a bad fetch call, it’s often CORS mischief.