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:
Version:
6.13.3
Description
Apologies if this was asked previously. I'm trying to integrate Sentry into background scripts of Chrome Extension manifest V3. Sentry Initi fails with the following trace, upon digging into it, the exact line where it fails is
https://imgur.com/a/UAGs5QR
Actual error trace:
Error in Sentry init TypeError: Cannot read properties of undefined (reading 'querySelector')
at y (background.bundle.js:118)
at g (background.bundle.js:118)
at e._createRouteTransaction (background.bundle.js:118)
at background.bundle.js:118
at a (background.bundle.js:127)
at e.setupOnce (background.bundle.js:118)
at l (background.bundle.js:79)
at background.bundle.js:79
at Array.forEach (<anonymous>)
at d (background.bundle.js:79)
at t.setupIntegrations (background.bundle.js:76)
at e.bindClient (background.bundle.js:103)
at o (background.bundle.js:94)
at Module.S (background.bundle.js:46)
at background.bundle.js:307
at background.bundle.js:307
at background.bundle.js:307
at background.bundle.js:307
This is expected to fail as the manifest V3 version of Chrome Extension background scripts don't have access to DOM, and they are run as service workers, which explains the issue. I would like to know if there is a way to integrate Sentry where window/document objects aren't present. Its really critical for us to integrate Sentry into the background scripts, as most of the important action happens there. Kindly assist if there is a solution or any workarounds for the problem. Thanks in advance.