Closed galvez closed 2 years ago
I'm not sure why you need to define the sharedConfig
. Wrapping the root with Suspense
should be enough to allow async/streaming to work.
Thank you @LXSMNSYC — Indeed wrapping the root in Suspense appears to do something, but it's not quite there.
I'll follow up with more info as soon as I can.
@LXSMNSYC No dice — wrapping the root in Suspense now gives me this error:
$ node server.js --dev
TypeError: ctx.writeResource is not a function
at Suspense (/Users/jonas/Fastify/fastify-dx/starters/solid/node_modules/solid-js/dist/server.cjs:511:9)
at Proxy.createComponent (/Users/jonas/Fastify/fastify-dx/starters/solid/node_modules/solid-js/dist/server.cjs:252:15)
This is where Solid support stands.
All examples are working except the streaming one.All examples are working now.
Lesson learned re: streaming issue:
renderToStream()
must be imported from the Vite bundle, you can't load Solid code from the Vite-managed environment andrenderToStream()
straight from the Node.js environment. It all must be loaded from the same Vite-managed environment.