fetch
fetch copied to clipboard
vercel/fetch returns 404 for calls that were returning 200 prior
Found this bug while working with https://github.com/transitive-bullshit/react-static-tweets/issues/43 and posted a gnarly post-install work-around over there.
The issue happens when doing a GET call on some endpoints, mine specifically being https://syndication.twitter.com/tweets.json?ids=296658470705438720.
I've confirmed with local calls in a (very friendly) loop to https://syndication.twitter.com/tweets.json?ids=296658470705438720 that that endpoint isn't intermittently returning 404. Actually, on the application instance, once a single 404 is returned it continues to return 404s which might indicate a state-related issue within vercel/fetch.
This is the line that causes the issue 404 in the aforementioned repo: https://github.com/transitive-bullshit/react-static-tweets/blob/4ff2e4e6eb138c3a98f364beb0117f0e2d5acc90/packages/static-tweets/src/twitter/api.ts#L16
I'll post more information / PR if I find anything helpful.
I'm seeing the same behavior with node-fetch
, where the result is intermittently 404 (on any tweet syndication url), although I'm not sure why yet. I'll keep digging, but I don't think this bug is specific to @vercel/fetch
.
The same behavior occurs using the underlying node:https
module directly, so this is definitely not an issue with @vercel/fetch
afaict.
The first GET
is always successful, and subsequent GET
requests 404. If you override the agent
to disable TLS session caching, then everything works fine.
hey @transitive-bullshit, you managed to fix the issue over here. Did you figure out if the issue is related to TLS session caching? If so, I can close this up.
Yep; I don't think this has anything to do with @vercel/fetch
.
Thank you for the report. We are archiving this project; you can read more details here: https://github.com/vercel/fetch/issues/83