Need help implementing Sentry v8 in Safari Web Extension (Manifest v3) #15257
Unanswered
edgariscoding
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone!
I'm trying to implement Sentry in my Safari Web Extension and running into some issues, particularly with the new v8 changes for browser extensions. I've read through the browser extension documentation (https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/) and understand that we can't use
Sentry.init()
anymore, but I'm having trouble getting any approach to work.My Setup
I have a Safari Web Extension (manifest v3) that uses webpack for bundling. The extension has the typical structure with background.js, content.js, and popup.js files. Here's what my webpack config looks like:
What I've Tried
But got this error:
TypeError: Module name, '@sentry/browser' does not resolve to a valid URL.
sentry.js
, including it directly, and adding it to manifest.json. Then using this instead:But got:
ReferenceError: Can't find variable: Sentry
. I ensured thatsentry.js
was showing up in the sources tab within web inspector.I feel like I'm missing something obvious about how to properly import Sentry in a browser extension context. I've researched online and there's lots of guides from people who have done this over the years but they're all using older versions of Sentry and I'm not sure if Safari is the one at fault here. Any guidance would be greatly appreciated!
Some specific questions:
Thanks in advance for any help! 🙏
Beta Was this translation helpful? Give feedback.
All reactions