-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed as not planned
Labels
Description
When importing @sentry/browser from a service worker file (e.g: background.js) like
import * as Sentry from '@sentry/browser';
we get
Uncaught TypeError: Cannot read properties of undefined (reading 'visibilityState')
var initHiddenTime = () => {
return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)().document.visibilityState === 'hidden' ? 0 : Infinity;
};
It crashes at the import level, because @sentry/browser relies on the document which doesn't exist in the context of a background script.
Edit: That's because I was loading BrowserTracing, when removing it it doesn't crash!
Originally posted by @Vadorequest in #4098 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status
Status
No status
Status
Waiting for: Community