open-frames / proxy

A proxy service for safely interacting with Frames and Open Graph data
MIT License
5 stars 2 forks source link

TypeError: Failed to fetch #16

Closed fabriguespe closed 6 months ago

fabriguespe commented 7 months ago

Hey,

I'm running into this error while rendering some buttons from popular Frames.

Examples: Frame: https://fc-polls.vercel.app/polls/87b1ed3f-5f86-479a-acc7-727943eecfe3 Repo: https://github.com/farcasterxyz/fc-polls or https://github.com/xmtp-labs/fc-polls Button: Create your poll

Frame: Repo: https://github.com/fabriguespe/a-frame-in-100-lines-main Frame: https://a-frame-in-100-lines-main.vercel.app/ Buttons: All

Live domain CleanShot 2024-03-17 at 15 26 19@2x

Localhost: CleanShot 2024-03-15 at 18 17 05@2x

Environment:

davidfurlong commented 7 months ago

Some ways to solve this

neekolas commented 6 months ago

I believe what's happening here is that we are only setting CORS headers on success but not on error. That causes the true source of these errors to be hidden (which is that we are sending POST requests that the servers don't understand and the remote server is returning an error status code)

alexrisch commented 6 months ago

@fabriguespe Agreeing with @neekolas here there is an error happening so the CORS headers aren't getting set. If we bypass the proxy it will also error, this is because a few of these frames don't support Open Frames POSTs https://github.com/fabriguespe/a-frame-in-100-lines/blob/main/app/api/frame/route.ts#L9