🐛 BUG: Server Sent Events (SSE) causes Error: The script will never generate a response.
#7767
Labels
bug
Something that isn't working
Which Cloudflare product(s) does this pertain to?
Wrangler, Miniflare, Pages
What versions are you using?
3.99.0 [wrangler], 3.20241218.0 [miniflare],
What operating system and version are you using?
Ubuntu [WSL]
Please provide a link to a minimal reproduction
No response
Describe the Bug
I have implemented server sent events (SSE) in a Remix/React Router v7 app using
remix-utils
and node native,EventEmitter
:The event emitter is shared and can be triggered elsewhere in the app. the
handleLog
function queues up messages for 250msWhen running this under node (eg
react-router dev
) it works perfectly - events stream to UI as expected (usinguseEventSource
from remix-utils)When building and running under
workerd
(egwrangler pages dev
) I get the errors:This seems like a bug to me as
EventEmitter
andReadableStream
/streaming responses are officially supported (and working in remix/react-router7 generally as streaming promises works as expected).I have tried adding a ctx.waitUntil in the functions handler, but this doesnt seem to do anything here
For completeness, this is my
[[path]].ts
file:Any help/guidance is welcome. This works so nicely... when it works
Please provide any relevant error logs
The text was updated successfully, but these errors were encountered: