Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): added falsy check to make otel core work with browser where webpack config had process as false or null #3617

Merged
merged 8 commits into from
Feb 27, 2023
2 changes: 1 addition & 1 deletion packages/opentelemetry-core/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export function parseEnvironment(values: RAW_ENVIRONMENT): ENVIRONMENT {
* populating default values.
*/
export function getEnvWithoutDefaults(): ENVIRONMENT {
return typeof process !== 'undefined'
return typeof process !== 'undefined' && process && process.env
Flarna marked this conversation as resolved.
Show resolved Hide resolved
? parseEnvironment(process.env as RAW_ENVIRONMENT)
: parseEnvironment(_globalThis as typeof globalThis & RAW_ENVIRONMENT);
}