Skip to content

Commit 2ca2823

Browse files
fix: ensure process is defined
1 parent 8710ac5 commit 2ca2823

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ class LightLivePreviewHoC {
7171
}
7272

7373
const ContentstackLivePreview =
74-
process?.env?.PURGE_PREVIEW_SDK === "true" ||
75-
process?.env?.REACT_APP_PURGE_PREVIEW_SDK === "true"
74+
typeof process !== "undefined" &&
75+
(process?.env?.PURGE_PREVIEW_SDK === "true" ||
76+
process?.env?.REACT_APP_PURGE_PREVIEW_SDK === "true")
7677
? LightLivePreviewHoC
7778
: ContentstackLivePreviewHOC;
7879

0 commit comments

Comments
 (0)