From 38a8268d2404ce295bc0dcd43bd890b03c5c9ece Mon Sep 17 00:00:00 2001 From: Cyrille <1618640+cyri113@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:50:28 +0200 Subject: [PATCH] Node.js compatibility --- src/client.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index dde5299..ca4e95e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -6,9 +6,11 @@ import * as LitJsSdk from "lit-js-sdk"; * @param {Window} window the window of the project, to which it attaches * a litNodeClient */ -export async function _startLitClient(window: Window) { +export async function _startLitClient(window: Window | null) { console.log("Starting Lit Client..."); const client = new LitJsSdk.LitNodeClient(); client.connect(); - window.litNodeClient = client; + if (window) { + window.litNodeClient = client; + } }