Can we already use Suspense with Meteor 3?

Hey guys,
does anybody know if there is already a working solution for SSR and Suspense (React)? We used renderToString to generate the initial HTML code on the server, but with using Suspense this is not possible anymore. Suspense is needed to receive the user object from the database. The new way to solve this is by using renderToPipeableStream - but there is no information available in the docs how we have to use it. Only the deprecated method renderToNodeStream is mentioned.

React 19 is out, and the use() hook + Suspense should work.

renderToPipeableStream requires a change in Meteor’s boilerplate. Looks like the new prerender API is the replacement for renderToString but I have not checked if it will also require changes in Meteor’s boilerplate

1 Like

Hey,
thanks for the reply. The problem is that if we use Suspense + renderToString, we get an error message on the page which says that Suspense is not supported with renderToString and we should move to renterToPipeableStream. But React 19 seems to be interesting, I’ll try and check if we could upgrade.

I took a look at the new prerender API. I confirmed that similar to renderToPipeableStream, the new APIs will also require changes to the Meteor boilerplate to allow react to render the entire <html/> node.

One shortcut is to use the React 18.3 canary that has the use() hook as I have done here while using renderToNodeStream (you have to live with the deprecation notice)