From 0ce0f9e8b43b37602ce9ebfa4d4d71f42332eb22 Mon Sep 17 00:00:00 2001 From: Pauan Date: Wed, 4 Oct 2023 06:19:48 -0700 Subject: [PATCH] Fixing crypto polyfill for Node 20+ --- sdk/src/polyfill/crypto.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/src/polyfill/crypto.ts b/sdk/src/polyfill/crypto.ts index c62757052..e6582badb 100644 --- a/sdk/src/polyfill/crypto.ts +++ b/sdk/src/polyfill/crypto.ts @@ -1,3 +1,5 @@ import { webcrypto } from "node:crypto"; -(globalThis as any).crypto = webcrypto; +if ((globalThis as any).crypto == null) { + (globalThis as any).crypto = webcrypto; +}