From 56f7d17126d0e09180e5a29d6089b302107cf2b0 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 16 Feb 2022 14:13:39 -0600 Subject: [PATCH] Ensure deps available --- server/render-hydrogen-to-string.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/render-hydrogen-to-string.js b/server/render-hydrogen-to-string.js index d8bcbe7..9b9c4c6 100644 --- a/server/render-hydrogen-to-string.js +++ b/server/render-hydrogen-to-string.js @@ -54,6 +54,8 @@ async function renderToString(roomData, events, stateEventMap) { vmContext.global.Node = dom.Node; vmContext.global.navigator = dom.navigator; vmContext.global.DOMParser = dom.DOMParser; + // Make sure `webcrypto` exists since it was only introduced in Node.js v17 + assert(crypto.webcrypto); vmContext.global.crypto = crypto.webcrypto; // So require(...) works in the vm