Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officially support React #40

Open
jennmueng opened this issue Jun 2, 2021 · 11 comments
Open

Officially support React #40

jennmueng opened this issue Jun 2, 2021 · 11 comments

Comments

@jennmueng
Copy link
Member

Add an example app, and fully test all features.

@davidemerritt
Copy link

Is this on the roadmap, does it only work with angular right now?

@jennmueng
Copy link
Member Author

@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).

@davidemerritt
Copy link

I have it working as you described but wondering what will break... Thanks for the update.

@piotr-cz
Copy link
Contributor

Works fine in production

import * as Sentry from '@sentry/capacitor'
import { init as sentryReactInit } from '@sentry/react'

Sentry.init({
  dsn: "__DSN__",
}, sentryReactInit)

@MaxWeisen
Copy link

MaxWeisen commented Jun 8, 2022

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)

Screen Shot 2022-06-07 at 5 49 02 PM

@piotr-cz
Copy link
Contributor

piotr-cz commented Jun 8, 2022

@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)

@lucas-zimerman
Copy link
Collaborator

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: getsentry/sentry-react-native#2250

@MaxWeisen
Copy link

@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!

@davidemerritt
Copy link

Any update on this?

@lucas-zimerman
Copy link
Collaborator

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.

@github-actions
Copy link
Contributor

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 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

7 participants