diff --git a/packages/auth-browser/src/lib/chains/eth.ts b/packages/auth-browser/src/lib/chains/eth.ts index 8ca7da797b..3e66c6f79f 100644 --- a/packages/auth-browser/src/lib/chains/eth.ts +++ b/packages/auth-browser/src/lib/chains/eth.ts @@ -42,10 +42,14 @@ import { } from '@lit-protocol/misc'; import { getStorageItem } from '@lit-protocol/misc-browser'; -if (typeof global.Buffer === 'undefined') { +if (global && typeof global.Buffer === 'undefined') { global.Buffer = BufferPolyfill; } +if (globalThis && typeof globalThis.Buffer === 'undefined') { + globalThis.Buffer = BufferPolyfill; +} + // log("naclUtil:", naclUtil); // log("nacl:", nacl);