Skip to content

Incorrect documentation for Sentry.registerWebWorker() #17443

Description

@medmunds

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

10.5.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

#16981 added Sentry.registerWebWorker(). However, the documentation repeatedly refers to it as Sentry.registerWorker(), which doesn't seem to exist. So do some comments in the code.

Steps to Reproduce

  1. npm install --save @sentry/browser@10.5.0
  2. Create service-worker.ts:
    import * as Sentry from "@sentry/browser";
    Sentry.registerWorker({ self });
  3. Attempt to compile it with tsc

Expected Result

No errors

Actual Result

TS2551: Property 'registerWorker' does not exist on type 
'typeof import(".../node_modules/@sentry/browser/build/npm/types/index")'.
Did you mean 'registerWebWorker'?

The answer to "Did you mean 'registerWebWorker'?" is yes. But that's not what's documented.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions