Open shahyar opened 1 week ago
Are you using the latest react-streaming
version? Make sure to double check you're using the latest version as recent versions fixed issues with that.
Definitely on the latest version.
Run DEBUG=react-streaming:chunks npm run ...
and paste the debug logs you get here.
Or provide a minimal reproduction if you prefer.
I have been trying to figure this out for a while, but for some reason, sometimes react-streaming/vike-react is outputting the initData blocks in the middle of my HTML.
For example (abbreviated for easier reading):
It doesn't happen on Vite's dev server. The problem seems to be worse the longer a page takes to render/the bigger the data in the async hydration.
The worker is pretty standard:
I also tried swapping it out for a
TransformStream
withhttpResponse.pipe
, but that had the same results.I don't have an example repo yet, as this is affecting a much larger codebase with some pretty complex workflows. But this is an example of the code which caused this:
This page's config is:
I believe setting
stream: false
will fix it, but that also gets rid of the React Stream.Am I doing something wrong? Is Cloudflare doing something wrong? Or is this just a very weird edge case?