[OpenTelemetry Web] Uncaught ReferenceError: window is not defined #1945
Unanswered
GideonCheruiyot
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Can you please provide more information? What browser version are you using? What opentelemetry packages are you using (with versions)? Paste your setup code and if possible a small code sample to reproduce the problem. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Getting an uncaught reference error from this file:, which called by config.ts. What are some scenarios where window would be undefined?
I am using the following opentelemetry packages:
Update: Looks like the issue happens when running the app in a service worker, and since web workers do not have DOM elements, both window and document that are used in opentelemetryweb would raise the undefined error when inside a service worker.
Added a hack to the serviceworker so as not to get this error:
Wondering if there could be a patch to support this scenario.
Beta Was this translation helpful? Give feedback.
All reactions