From 37140f7fd51b1b1f0575bf645244c1b63b8f6643 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Mon, 27 Sep 2021 12:11:43 -0400 Subject: [PATCH] [core] fix(classes.ts): compatibility with non-Node environments (#4934) --- packages/core/src/common/classes.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/common/classes.ts b/packages/core/src/common/classes.ts index 538bbdb4ee..f294601f33 100644 --- a/packages/core/src/common/classes.ts +++ b/packages/core/src/common/classes.ts @@ -19,7 +19,10 @@ import { Elevation } from "./elevation"; import { Intent } from "./intent"; import { Position } from "./position"; -const NS = process.env.BLUEPRINT_NAMESPACE || process.env.REACT_APP_BLUEPRINT_NAMESPACE || "bp3"; +let NS = "bp3"; +if (typeof process !== "undefined") { + NS = process.env?.BLUEPRINT_NAMESPACE ?? process.env?.REACT_APP_BLUEPRINT_NAMESPACE ?? NS; +} // modifiers export const ACTIVE = `${NS}-active`;