Skip to content

Commit bd51da7

Browse files
msopacualukeocodes
authored andcommitted
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.
1 parent 8756508 commit bd51da7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DeepgramClientOptions } from "./types/DeepgramClientOptions";
33
import { FetchOptions } from "./types/Fetch";
44
import { version } from "./version";
55

6-
export const NODE_VERSION = process.versions.node;
6+
export const NODE_VERSION = process?.versions.node || "Unknown";
77

88
export const DEFAULT_HEADERS = {
99
"Content-Type": `application/json`,

0 commit comments

Comments
 (0)