Node version 19 was released last week, and there appears to be a difference in how the loadCrypto function is evaluated.
In Node 16, for example, this condition is not evaluated and crypto is loaded dynamically. However, in Node 19, it appears that the condition is evaluated, producing the ReferenceError: window is not defined message. I'm unsure if this is a bug in Node 19 or if it's an intentional breaking change.
This is the output when running the CLI using Node 19:
file:///Users/pagecrypt/cli.js:16
const crypto2 = window.crypto || globalThis.crypto;
^
ReferenceError: window is not defined
Ref: https://github.com/render-examples/pagecrypt/issues/1
Node version 19 was released last week, and there appears to be a difference in how the
loadCrypto
function is evaluated.In Node 16, for example, this condition is not evaluated and
crypto
is loaded dynamically. However, in Node 19, it appears that the condition is evaluated, producing theReferenceError: window is not defined
message. I'm unsure if this is a bug in Node 19 or if it's an intentional breaking change.This is the output when running the CLI using Node 19: