diff --git a/packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts b/packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts index 2da12ecbe7..ba07bbd725 100644 --- a/packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts +++ b/packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts @@ -8,8 +8,10 @@ */ export const normalizeArray = (toSign: ArrayLike) => { const arr = []; - for (let i = 0; i < toSign.length; i++) { - arr.push((toSign as Buffer)[i]); + // Casting ArrayLike to Uint8Array for better compatibility and avoiding Node-specific types + const uint8Array = new Uint8Array(toSign); + for (let i = 0; i < uint8Array.length; i++) { + arr.push(uint8Array[i]); } return arr; };