Closed Achrou closed 1 year ago
Could this be why I'm not able to use readBody via cloudflare workers but can via npm run? https://github.com/nuxt-modules/supabase/issues/133#issuecomment-1361868398
I think his broke useBody in cloudflare workers @danielroe since the update
For what it's worth, this still breaks for me. One example is, autogenerated routes like the one I just installed with nuxt/turnstile. Another is still, nuxt/supabase that tries to store cookies (again, with an auto generated route that I had to fake with a redirect)
For anyone arriving here before this is fixed (I would love to send a PR, just not sure where) here's my workaround:
https://gist.github.com/altryne/54747e1a7b6d4adecc490f60dd0f636a
@pi0 would you welcome a fix here? (my override above works, but it's def. not the best way around this)
It seems that all the pieces are there, it just needs a proper detection that an readabaleStream in the form of one that is cloudflare is incoming.
I think this is now closed here: https://github.com/unjs/h3/issues/363
Support for readable stream responses added via #457. Please check readme about nightly channel if you like to early test before release.
In Cloudflare Workers , ReadableStream does not have
pipe
andon
functions; resulting in a response type ofjson
https://github.com/unjs/h3/blob/f09ce91911cf5657a66a3a69a88a512c931d2be0/src/utils/response.ts#L47
For more information about Cloudflare Workers ReadableStream, please see:https://developers.cloudflare.com/workers/runtime-apis/streams/readablestream/#methods