From 2499888e3fea32eee22f190879f60c5a1e265d1d Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Tue, 19 Aug 2025 00:44:20 +0000 Subject: [PATCH] fix: otel symbol may not be exposed in some cases --- examples/main/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/main/index.ts b/examples/main/index.ts index 45779bd4c..28ec12266 100644 --- a/examples/main/index.ts +++ b/examples/main/index.ts @@ -7,8 +7,10 @@ import { context, propagation } from "npm:@opentelemetry/api"; import { W3CBaggagePropagator } from "npm:@opentelemetry/core@1"; // @ts-ignore See https://github.com/denoland/deno/issues/28082 -globalThis[Symbol.for("opentelemetry.js.api.1")].propagation = - new W3CBaggagePropagator(); +if (globalThis[Symbol.for("opentelemetry.js.api.1")]) { + globalThis[Symbol.for("opentelemetry.js.api.1")].propagation = + new W3CBaggagePropagator(); +} console.log("main function started"); console.log(Deno.version);