diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fe123316..bf22d31a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +- 6.6.6 + - Fix issue with process global (PR #1166) (issue #1165) - 6.6.5 - Support import fom SQL (`SqlUtils.loadFromSql`) (PR #1103) (issue #911, #593) - Fixed type issue with SerializedFunction (PR #1103) (issue #1024) diff --git a/packages/core/modules/utils/stuff.js b/packages/core/modules/utils/stuff.js index 3b92075ec..f6647d706 100644 --- a/packages/core/modules/utils/stuff.js +++ b/packages/core/modules/utils/stuff.js @@ -521,8 +521,8 @@ export const isJsonCompatible = (tpl, obj, bag = {}, path = []) => { } }; -const isDev = () => (process?.env?.NODE_ENV == "development"); -const isTest = () => (process?.env?.NODE_ENV_TEST == "true"); +const isDev = () => (typeof process !== "undefined" && process?.env?.NODE_ENV == "development"); +const isTest = () => (typeof process !== "undefined" && process?.env?.NODE_ENV_TEST == "true"); export const getLogger = (devMode) => { if (isTest()) { diff --git a/packages/ui/modules/utils/stuff.js b/packages/ui/modules/utils/stuff.js index b4da25770..52d565e9a 100644 --- a/packages/ui/modules/utils/stuff.js +++ b/packages/ui/modules/utils/stuff.js @@ -97,8 +97,8 @@ function shallowEqualObjects(objA, objB, deep = false) { } -const isDev = () => (process?.env?.NODE_ENV == "development"); -const isTest = () => (process?.env?.NODE_ENV_TEST == "true"); +const isDev = () => (typeof process !== "undefined" && process?.env?.NODE_ENV == "development"); +const isTest = () => (typeof process !== "undefined" && process?.env?.NODE_ENV_TEST == "true"); export const getLogger = (devMode) => { if (isTest()) {