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.22.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Setup according to https://docs.sentry.io/platforms/javascript/best-practices/web-workers/#recommended-setup
main.ts
import * as Sentry from "@sentry/browser";
import MyWorker from "./worker.ts?worker";
const worker = new MyWorker();
Sentry.init({
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
debug: true,
integrations: [
Sentry.webWorkerIntegration({ worker })
],
beforeSend() {
console.log('beforeSend', ...arguments);
return null;
}
});
worker.ts
import * as Sentry from "@sentry/browser";
Sentry.registerWebWorker({ self });
self.postMessage("Worker ready!");
setTimeout(() => {
throw new Error('worker error');
}, 1000);
(async function() {
await new Promise(resolve => setTimeout(resolve, 1000));
throw new Error('worker async error');
})();
Steps to Reproduce
- Create an empty project (vite in my case)
- Configure it using my snippets
- Open in Chrome browser (Version 141.0.7390.108 (Official Build) (arm64), MacOS)
- See console
Expected Result
beforeSend was called twice, with 'worker error' and 'worker async error'
Actual Result
beforeSend was called once, with 'worker error'
Additional Context
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
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.22.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Setup according to https://docs.sentry.io/platforms/javascript/best-practices/web-workers/#recommended-setup
main.ts
worker.ts
Steps to Reproduce
Expected Result
beforeSendwas called twice, with 'worker error' and 'worker async error'Actual Result
beforeSendwas called once, with 'worker error'Additional Context
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it.