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 60c04b1 commit c6199f7Copy full SHA for c6199f7
packages/opentelemetry-core/src/platform/browser/environment.ts
@@ -25,7 +25,9 @@ import {
25
* Gets the environment variables
26
*/
27
export function getEnv(): Required<ENVIRONMENT> {
28
- const _window = window as typeof window & RAW_ENVIRONMENT;
+ const _window = (typeof window === 'undefined'
29
+ ? self
30
+ : window) as typeof window & RAW_ENVIRONMENT;
31
const globalEnv = parseEnvironment(_window);
32
return Object.assign({}, DEFAULT_ENVIRONMENT, globalEnv);
33
}
0 commit comments