Can't get fetch to work in server code
Hi all,
I have a simple form and action like so:
And my function being called is like so:
But for some reason when i try to submit the form and run this code, it only gets to right before the
fetch
since it console logs About to fetch...
but it never logs the response. There is no error being thrown, or anything at all. I checked the browser console and my server logs (showing About to fetch...
), but nothing shows after that.
What could be going wrong?4 Replies
Hm, probably the fetch never resolves?
What happens when you comment out the fetch?
Hi! Thanks for your help with this.
correct, when i comment out the fetch it works just fine, but as soon as i do any kind of fetch, it doesn't work and seems to fail silently or never resolve.
What node version are you using? Fetch is native in node from version 18. Maybe you need to install node-fetch?
Hard to tell without code,..
I was able to fix it, hidden error with the proxy
I had to do the following before i fetched with my proxy: