Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nested Frameworks SDK Support? #17166

Unanswered
agoldstein03 asked this question in Q&A
Discussion options

Hello! It seems like there might have a start to this in #9188 but I figured I would check back in case the answer has changed, and because this situation is a bit different. We have a large application built in SolidStart which within it has some client-side bridge code to allow a React application to run inside of it. Please note these are not just two web applications both running on the same page; the React render function is called inside of the Solid.js render code (which appears in stack traces and such, and for that reason might affect tracing?). We would love to get the full SolidStart SDK support working, as well as the nice React SDK integration for that sub-application.

My best understanding is that I could follow the SolidStart SDK setup process normally (https://docs.sentry.io/platforms/javascript/guides/solidstart/), then just import and set up the error hooks for the React SDK (https://docs.sentry.io/platforms/javascript/guides/react/#configure-error-hooks-react-19), and it should "just work". Should I expect that to work? Would that preserve all the niceties of the React integration, is there any additional important setup happening in the React SDK init vs the SolidStart SDK init?

I checked the source code for the React SDK's init just in case (https://github.com/getsentry/sentry-javascript/blob/develop/packages/react/src/sdk.ts), besides the applySdkMetadata(opts, 'react'); bit (which I'm really hoping doesn't have broader effects besides metadata for logging 🤞 ), there's also:

import { setContext } from '@sentry/browser';
import { version } from 'react';
...
setContext('react', { version });
...

Is that worth separating out and running when I load the React application, before rendering w/ the error hooks? Is there anything else I might have missed?

I also want to get an idea if there are any issues I should be on the look-out for, if these framework SDKs like the React SDK are made to be called inside of another tracing context, or if that could lead to issues somehow, not sure.

And to be clear, I am happy for all these errors to go to the same project, or if it would be a lot easier to separate them, that would be okay too. I just want to make sure my setup won't end up causing issues down the line 🙂

Thanks y'all!

You must be logged in to vote

Replies: 1 comment

Comment options

Hey, I think what you lined out should work. @sentry/react init() does not do much special stuff, as you pointed out, so I believe this should all play together reasonably well!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /