jsdom-global icon indicating copy to clipboard operation
jsdom-global copied to clipboard

Node.js URL gets undefined

Open vascoyannic opened this issue 1 year ago • 1 comments

Hey,

just had this weird behaviour with the following code:

const jsdomGlobal = require('global-jsdom');

console.log(URL, "Test 1");
const cleanup = jsdomGlobal("<html><body></body></html>");
console.log(URL, "Test 2");
cleanup();
console.log(URL, "Test 3");

Test 1 and Test 2 print to the console just as expected, however Test 3 throws ReferenceError: URL is not defined

vascoyannic avatar Jul 18 '22 15:07 vascoyannic

I encountered the same with Blob on node >= 18 after cleanup: ReferenceError: Blob is not defined

vilyus avatar Mar 17 '23 09:03 vilyus