Description
Version
3.2.0-beta.7
Reproduction link
https://github.com/Cherry/workers-vue-ssr-example
The src/index.mjs file contains a really simple Hello World Vue App, attempting to be rendered server-side. It has 3 different solutions in the code, in this order:
- Native
- via
TransformStream
- Buffering stream in memory
Each is commented out, with the only one actually working being 3, buffering in memory.
Steps to reproduce
See the attached reproduction repo for more information.
- Setup Cloudflare Wrangler environment. See https://developers.cloudflare.com/workers/cli-wrangler/install-update and https://developers.cloudflare.com/workers/cli-wrangler/authentication
- Note you will need an account with the new ESM syntax enabled. See https://developers.cloudflare.com/workers/learning/using-durable-objects
npm ci
wrangler dev
- Hit
http://127.0.0.1:8787/
- Comment in/out each solution in the
src/index.mjs
to see how it works. The currently enabled code is the "native" variant, which will throw aFailed to construct 'ReadableStream': the constructor is not implemented.
error.
What is expected?
When using SSR and renderToWebStream
, Options 1 and/or 2 should work without issue. The docs in @vue/server-renderer
seem to suggest this is possible, but all attempts have resulted in errors.
What is actually happening?
Options 1 and 2 throw errors, either relating to ReadableStream
not being a constructor, or there being no response. More information can be found in the README of the attached reproduction repo.
If I can provide any more information, please let me know and I'll be happy to.