-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
@sentry/next
Version:
6.11.0
Description
Introducing a web worker into my app (which already has a @sentry/next
integration), my worker module fails to load, saying document is not defined
(because document
does not exist in a Web Worker). I get this in the browser console, showing that the failure occurs in Sentry code which accesses document
:
getVisibilityWatcher.js?84da:19 Uncaught ReferenceError: document is not defined
at initHiddenTime (getVisibilityWatcher.js?84da:19)
at getVisibilityWatcher (getVisibilityWatcher.js?84da:34)
at getLCP (getLCP.js?00a4:23)
at MetricsInstrumentation._trackLCP (metrics.js?b67e:235)
at new MetricsInstrumentation (metrics.js?b67e:20)
at new BrowserTracing (browsertracing.js?cc79:26)
at eval (index.client.js?f3e4:25)
at Module../node_modules/@sentry/nextjs/esm/index.client.js (src_engine_worker_js.js:972)
at Module.options.factory (src_engine_worker_js.js:2562)
at __webpack_require__ (src_engine_worker_js.js:2051)
Probably that LCP code (and I'm guessing some more of BrowserTracing) should not be called into at all, when executing in a web worker.
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK