`fetch` not working in Next.js API, the strangest issue I've encountered
I'm using t3 with pages router, and in one particular API call I'm trying to fetch a particular image and save it in my GCS bucket. The code has access to GCS bucket (confirmed) & the imageUrl is logged and tested, works perfectly fine.
If you fetch it normally in browser console it works, if you fetch in reqbin it returns a 200.
Not pasting entire code here but here's the important bit:
I am stumped as to why after the line
const response = await fetch(imageUrl
the code stops working ENTIRELY.
Here's my server logs1 Reply
Some more info:
Hosted on vercel (pro) so there's no timeout, current function runs for 1.59s out of 20s limit.
Tried it multiple times doesn't work.
Fails BEFORE uploading to GCS so it's not a GCS issue.
Happy to provide more context if needed.
okay fyi this was a ME error.