Ensure deps available

This commit is contained in:
Eric Eastwood 2022-02-16 14:13:39 -06:00
parent 5386c5aac7
commit 56f7d17126
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,8 @@ async function renderToString(roomData, events, stateEventMap) {
vmContext.global.Node = dom.Node; vmContext.global.Node = dom.Node;
vmContext.global.navigator = dom.navigator; vmContext.global.navigator = dom.navigator;
vmContext.global.DOMParser = dom.DOMParser; 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; vmContext.global.crypto = crypto.webcrypto;
// So require(...) works in the vm // So require(...) works in the vm