sentry-capacitor
sentry-capacitor copied to clipboard
Officially support React
Add an example app, and fully test all features.
Is this on the roadmap, does it only work with angular right now?
@davidemerritt Yep this is a roadmap item. It officially only works with angular, however in theory React should already work just fine and you can pass @sentry/react
as the second parameter to this init call not unlike the angular SDK. If you run into any issues you can just initialize the standalone Sentry Capacitor SDK(Use the "Other Frameworks" tab).
I have it working as you described but wondering what will break... Thanks for the update.
Works fine in production
import * as Sentry from '@sentry/capacitor'
import { init as sentryReactInit } from '@sentry/react'
Sentry.init({
dsn: "__DSN__",
}, sentryReactInit)
Currently implementing sentry with @sentry/capacitor
and @sentry/vue
but having trouble with BrowserTracing
How would you initialize BrowserTracing
in this situation?
Example of what I have below
import * as Sentry from '@sentry/capacitor'
import * as SentryVue from '@sentry/vue'
Sentry.init({
app,
dsn: "__DSN__",
integrations: [new BrowserTracing()] // <- TS error
}, SentryVue.init)

@MaxWeisen
Try pinning @sentry/vue
to same version as in @sentry/capacitor
's peeerDependencies:
npm install --save-exact @sentry/[email protected]
For explaination see https://github.com/getsentry/sentry-javascript/issues/4474#issuecomment-1028292131
Yes, for the time being, sentry/capacitor is not compatible with the newer versions of Sentry/vue, react, angular (7.x). An update to the SDK will be done after the conclusion of the following update to React Native: https://github.com/getsentry/sentry-react-native/pull/2250
@MaxWeisen Try pinning
@sentry/vue
to same version as in@sentry/capacitor
's peeerDependencies:npm install --save-exact @sentry/[email protected]
For explaination see getsentry/sentry-javascript#4474 (comment)
This works. Thank you for posting!
Any update on this?
Any update on this?
Currently the Capacitor SDK is working just fine with React. The next goal with this PR will be to implement a sample app using React and Sentry Capacitor.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀