From 0bd21413cbc20fc8b7dcd5df4227170fd324474d Mon Sep 17 00:00:00 2001 From: Perlover Date: Tue, 1 Dec 2020 10:14:45 +0100 Subject: [PATCH] fix(server): remove `virtualConsole` option when disabled (#8263) --- packages/server/src/jsdom.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/jsdom.js b/packages/server/src/jsdom.js index 516fab8779..7cc0927fbe 100644 --- a/packages/server/src/jsdom.js +++ b/packages/server/src/jsdom.js @@ -43,6 +43,9 @@ export default async function renderAndGetWindow ( } // Throw error when window creation failed options.virtualConsole.on('jsdomError', jsdomErrHandler) + } else { + // If we get the virtualConsole option as `false` we should delete for don't pass it to `jsdom.JSDOM.fromURL` + delete options.virtualConsole } const { window } = await jsdom.JSDOM.fromURL(url, options)