Next.js/Vercel AI/Streaming Issue

I want to make cloudflare aware of this issue. It seems using Cloudflare with Vercel's AI package (on Vercel hosting) if the proxy feature is on for Cloudflare steaming responses no longer works. https://github.com/vercel/ai/issues/633
GitHub
Stream Response does not work properly with Cloudflare DNS settings...
Description Issue In our production environment, the Stream Response doesn't seem to work as expected. Instead of streaming the response, it loads and immediately returns the full response. Int...
34 Replies
someguy
someguy12mo ago
Just pinging this again, it seems Vercel is indicating it's on Cloudflare's end
joulev
joulev12mo ago
same issue here, hope someone looks into this soon
ack
ack12mo ago
Hey @someguy can you walk me through your setup and where this is failing please? Want to confirm what Vercel is saying
someguy
someguy12mo ago
Using vercel preview domain (on their subdomain), streaming from OpenAI works (using Vercel/Vercel's AI package with their streaming commands) Using the live site proxy'd behind CF using their IP in an A record (76.76.21.21) the stream appears to just return as one massive chunk, so functionally still works but streaming just seems to be off. Oddly enough I have a second project that uses Vercel on a subdomain which uses a cname instead (using CF proxy also) and streaming works. So I wonder if it's an issue between A record/Cname let me know if this helps! Just tested that theory and it doesn't seem to matter if it's an A record/Cname, must be different project details If you want a test account feel free to DM me, I turned the proxy off and can confirm it works with it off, then stops working with it on
someguy
someguy12mo ago
weirdly enough they both projects use the same vercel call and function
No description
ack
ack12mo ago
interesting bug.... the CNAME website to the A rec website though?
someguy
someguy12mo ago
Ignore the cname mention, it doesn't seem related
ack
ack12mo ago
ok so the only difference is that 1 is through the vercel preview domain and the other is a custom zone you have with vercel?
someguy
someguy12mo ago
The main difference is turning the CF proxy option off/on is that causes the issue so I can only guess it's CF causing the issue
ack
ack12mo ago
maybe... where is this CF proxy option you're interacting with? on vercel or is it when you change DNS to cloudflare?
someguy
someguy12mo ago
This option
No description
someguy
someguy12mo ago
in Cloudflare
ack
ack12mo ago
what's the website? can DM too if you dont want to talk about it publicly.
someguy
someguy12mo ago
RightBlogger Blog
RightBlogger: AI-Powered Content Tools for Bloggers
RightBlogger is a collection of 50+ high-powered tools for bloggers to better research, create, optimize, and promote your content.
someguy
someguy12mo ago
All functions that involve streaming require login (you can make a free account to submit one time per tool) you'll see the response just is one large output rather than streaming
Want results from more Discord servers?
Add your server