Cloudflare Pages + SvelteKit streaming responses
Hi everyone, I'm struggling to stream my response using Cloudflare Pages (Workers underneath for dynamic requests) + SvelteKit. I created a minimal reproducible example to showcase the issue.
When this endpoint is called, the response is buffered and delivered as a whole, after all characters are read, with no
I referenced other topics in this forum (workers-and-pages-helpHow to make a Worker stream (an OpenAI) response back to the front-end?) to create this example, which I'm sure it should be working. Does anyone have any idea what to fix in below code? Thanks in advance
stream is mocking an object implementing a LLM.When this endpoint is called, the response is buffered and delivered as a whole, after all characters are read, with no
Transfer-Encoding: chunked. When run locally with Vite, the response is streamed correctly.I referenced other topics in this forum (workers-and-pages-helpHow to make a Worker stream (an OpenAI) response back to the front-end?) to create this example, which I'm sure it should be working. Does anyone have any idea what to fix in below code? Thanks in advance