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
Just pinging this again, it seems Vercel is indicating it's on Cloudflare's end
same issue here, hope someone looks into this soon
Hey @someguy can you walk me through your setup and where this is failing please? Want to confirm what Vercel is saying
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
weirdly enough they both projects use the same vercel call and function
interesting bug.... the CNAME website to the A rec website though?
Ignore the cname mention, it doesn't seem related
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?
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
maybe... where is this CF proxy option you're interacting with? on vercel or is it when you change DNS to cloudflare?
This option
in Cloudflare
what's the website? can DM too if you dont want to talk about it publicly.
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.
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