You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect TypeScript typings for Sentry.registerWebWorker() #17444
Sentry.registerWebWorker() is intended to be called from within a worker's implementation. But its TypeScript typings expect a Worker instance, which is only available in the thread that created new Worker(). The type of self within the worker instance will be an extension of WorkerGlobalScope (DedicatedWorkerGlobalScope or ServiceWorkerGlobalScope or SharedWorkerGlobalScope), not Worker.
TS2322: Type 'DedicatedWorkerGlobalScope' is not assignable
to type 'Worker & { _sentryDebugIds?: Record<string, string> | undefined; }'.
Property 'terminate' is missing in type 'DedicatedWorkerGlobalScope' but required in type 'Worker'.
Screenshot:
Workaround:
Sentry.registerWebWorker({selfas unknown as Worker });
Activity
linear commentedon Aug 22, 2025
JS-878 Incorrect TypeScript typings for Sentry.registerWebWorker()
Lms24 commentedon Aug 22, 2025
Thanks, will take a look on Monday
Lms24 commentedon Aug 25, 2025
Opened #17447 with the fix. We'll include this in the next release sometime this week. Thanks for reporting!
github-actions commentedon Aug 26, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #17447, which was included in the 10.6.0 release.