We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1be6315 commit 36e6e4dCopy full SHA for 36e6e4d
‎packages/core/src/tools/globalObject.ts‎
@@ -50,6 +50,6 @@ export const globalObject = getGlobalObject<GlobalObject>()
50
51
export const isBrowserEnvironment = 'document' in globalObject
52
export const isWorkerEnvironment = 'WorkerGlobalScope' in globalObject
53
-// @see https://stackoverflow.com/questions/4224606/how-to-check-whether-a-script-is-running-under-node-js
54
-// @ts-expect-error module is undefined outside of Node.
55
-export const isNodeEnvironment = typeof module !== 'undefined' && module.exports
+export const isNodeEnvironment =
+ // @ts-expect-error for Node.js-specific globals that are not present in browser environments
+ typeof process !== 'undefined' && process.versions !== null && process.versions.node !== null
0 commit comments