Discussing Sentry integration in Sanity Studio and possible solutions

5 replies
Last updated: Apr 28, 2021
I read about how the Sanity Team handle support using the “Support Studio” . However, is it possible to have some feedback on issues opened there or see the issue status/priority? I posted here (a week or 2 ago) about integrating Sentry into Sanity and didn’t get any feedback on the subject. Did anyone ever implement this or another similar crash reporting solution in a Sanity Studio?
Apr 27, 2021, 6:08 PM
Hi User, sorry about missing your earlier question. Unfortunately, I've only seen a single Sentry integration on a Sanity project, so there's not too much to go on.
However, I know they struggled with finding an entry point that was sufficiently early in the app lifecycle. In the end they placed the Sentry code as first import in their 
schema.js
 file. They then ensured that the schema part came first in the 
parts
 array of their 
sanity.json
 file - the one named 
part:@sanity/base/schema
.
Does this help at all in getting started? Do let me know if you have specific questions about the integration - I could try reaching out to the project mentioned above.
Apr 28, 2021, 8:31 AM
Hi Peter, thanks for the reply! Of course, this is not really the solution I wished for, as ideally I would have preferred to hook at the very beginning of the App Lifecycle. However, I feel like this solution should catch pretty much 99.9% of the potential crashes and errors that could occur in the Studio.Thanks for the tip! It is quite a clever solution!
Apr 28, 2021, 12:05 PM
Hi Peter, thanks for the reply! Of course, this is not really the solution I wished for, as ideally I would have preferred to hook at the very beginning of the App Lifecycle. However, I feel like this solution should catch pretty much 99.9% of the potential crashes and errors that could occur in the Studio.Thanks for the tip! It is quite a clever solution!
Apr 28, 2021, 12:05 PM
Agreed, it's not ideal and we should figure out if there's a way to hook this earlier. However, this should indeed catch nearly all issues, in particular with custom components as they'll all come after the first schema import this way.
Apr 28, 2021, 12:31 PM
Yes, I think this should catch most errors related to plugin loading and custom components. Of course, I think most errors will be more likely to occur once the editor interface loaded (and therefore the schemas loaded). If an error occur even before the Studio correctly loads, we’ll probably here about it from the client 😅
Apr 28, 2021, 12:33 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?