Skip to content

Commit

Permalink
fix: unconditional process reference
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
msopacua authored and lukeocodes committed May 20, 2024
1 parent 8756508 commit bd51da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit bd51da7

Please sign in to comment.