keel icon indicating copy to clipboard operation
keel copied to clipboard

fix: check for crypto before importing module

Open RutZap opened this issue 9 months ago • 0 comments

Check if crypto is set before attempting to set the property.

This issue came up when using newer versions of node. It seems that starting with node@19, crypto was no longer experimental and therefore included as a built-in module, globalThis.crypto, thus attempting to set it on globalThis as a polyfill would end up with an error:

TypeError: Cannot set property crypto of #<Object> which has only a getter

RutZap avatar May 08 '24 13:05 RutZap