From bd51da7ce06c59b3dea55e4a915e802bd43a3754 Mon Sep 17 00:00:00 2001 From: "M.R. Sopacua" <144725145+msopacua@users.noreply.github.com> Date: Mon, 20 May 2024 15:01:25 +0200 Subject: [PATCH] fix: unconditional process reference process does not exist in the browser and therefore throws an error if one tries to create a client in the browser. Fix it in a way that's compatible with any (future) engine that doesn't have a process global. --- src/lib/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f19cb92..818f9d0 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -3,7 +3,7 @@ import { DeepgramClientOptions } from "./types/DeepgramClientOptions"; import { FetchOptions } from "./types/Fetch"; import { version } from "./version"; -export const NODE_VERSION = process.versions.node; +export const NODE_VERSION = process?.versions.node || "Unknown"; export const DEFAULT_HEADERS = { "Content-Type": `application/json`,