createServerAction$, ReadableStream, and createEffect are inconsistent across dev and prod
I have a route component that looks mostly like this, it creates a server action that makes an Axios request with the streaming configuration set to true (this part works). The action is submitted using the provided Form component, then I use
createEffect
to track the streaming response body content as it arrives.
In dev mode, it works as expected with each chunk being added to the page as intended. But when I build and run in prod, the app waits until the entire request is returned before adding the whole response body to the page.
This seems like a bug in the way createServerAction$
handles streams in Response
objects, or maybe how createEffect
treats the first item returned from the createServerAction$
array (prompt
in this case).
Has anyone had success implementing streaming responses? Note that this does not use server sent events.0 Replies