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
received an error message: Uncaught SyntaxError: Cannot use import statement outside a module (at content.js:11:1)
in package.json, added a top-level key "type": "module" (but this did not fix the issue as stackoverflow suggested). More stackoverflowing led to more dead ends 😕
Another resource I looked into: adding sentry to chrome extension — this was not exactly needed since technically content.js does not run as a service worker — it gets appended to the DOM using injectScript
I also tried injecting the sentry script itself, re-using the injectScript function but passing the src as the CDN sentry link. But when I do that, then try to Sentry.init I get: Uncaught ReferenceError: Sentry is not defined.
random idea: if there is an error (with content.js), store the error in localstorage, and then have popup.js read off of that and send up (via Sentry.captureException / captureMessage) ? (edited)
^ i.e. wrap all of content.js essentialy in a try/catch, and then do the above in catch?
The text was updated successfully, but these errors were encountered:
cstavitsky
changed the title
Improve Sentry instrumentation
Improve Sentry instrumentation of the extension itself
Nov 6, 2024
What we currently do, what I tried:
installed Sentry using npm
configured Sentry per normal JS instructions, initializing it in content.js
received an error message: Uncaught SyntaxError: Cannot use import statement outside a module (at content.js:11:1)
in package.json, added a top-level key "type": "module" (but this did not fix the issue as stackoverflow suggested). More stackoverflowing led to more dead ends 😕
Another resource I looked into: adding sentry to chrome extension — this was not exactly needed since technically content.js does not run as a service worker — it gets appended to the DOM using injectScript
I also tried injecting the sentry script itself, re-using the injectScript function but passing the src as the CDN sentry link. But when I do that, then try to Sentry.init I get: Uncaught ReferenceError: Sentry is not defined.
@ndmanvar 's idea for improvement:
random idea: if there is an error (with content.js), store the error in localstorage, and then have popup.js read off of that and send up (via Sentry.captureException / captureMessage) ? (edited)
^ i.e. wrap all of content.js essentialy in a try/catch, and then do the above in catch?
The text was updated successfully, but these errors were encountered: