-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nextjs integration breaks module load completely in Web Worker, with "document is not defined" #3934
Closed
4 of 9 tasks
Labels
Comments
gthb
changed the title
Nextjs integration tries to act in Web Worker and borks with "document is not defined"
Nextjs integration breaks module load completely in Web Worker, with "document is not defined"
Aug 31, 2021
gthb
added a commit
to gthb/raven-js
that referenced
this issue
Aug 31, 2021
Minimal fix for getsentry#3934
Seems like this hinges on sentry-javascript/packages/tracing/src/browser/metrics.ts Lines 26 to 34 in 949f1b6
... in a worker, global will be self , which does have the performance attribute, so this will try to instrument the worker for CLS and LCP and FID, which makes no sense (and fails, because that code reasonably assumes there's a document )
|
2 tasks
gthb
added a commit
to gthb/raven-js
that referenced
this issue
Aug 31, 2021
Minimal fix for getsentry#3934
AbhiPrasad
added
Package: nextjs
Issues related to the Sentry Nextjs SDK
Status: In Progress
Type: Bug
labels
Aug 31, 2021
AbhiPrasad
pushed a commit
that referenced
this issue
Aug 31, 2021
Will be included with the next release, thanks for your help with the fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)@sentry/next
Version:
Description
Introducing a web worker into my app (which already has a
@sentry/next
integration), my worker module fails to load, sayingdocument is not defined
(becausedocument
does not exist in a Web Worker). I get this in the browser console, showing that the failure occurs in Sentry code which accessesdocument
: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.
The text was updated successfully, but these errors were encountered: