diff --git a/packages/browser/src/plugins/env-enrichment/index.ts b/packages/browser/src/plugins/env-enrichment/index.ts index aa41ca889..3b1c183e3 100644 --- a/packages/browser/src/plugins/env-enrichment/index.ts +++ b/packages/browser/src/plugins/env-enrichment/index.ts @@ -140,11 +140,11 @@ class EnvironmentEnrichmentPlugin implements Plugin { } private enrich = (ctx: Context): Context => { - // Note: context should never actually be undefined here, since it is set as part of event creation. + // Note: Types are off - context should never be undefined here, since it is set as part of event creation. const evtCtx = ctx.event.context! - // Note: page should never be undefined here, since it is set as part of event creation. - const search = evtCtx.page!.search || '' + // Note: Types are off - page nor page.search never be undefined here, since they are set as part of event creation. + const search = evtCtx.page!.search! const query = typeof search === 'object' ? objectToQueryString(search) : search