Add support for Rescript #8952
Replies: 3 comments 1 reply
-
Hey @listepo, thanks for writing in. You can include the Something like (sorry it's been 3+ years since I wrote rescript/reasonml/bucklescript so there might be some mistakes in syntax) open Sentry
@module("@sentry/browser")
external sentryInit: 'a => unit = "init"
@module("@sentry/browser")
external sentryCaptureException: 'a => unit = "captureException"
This will allow you to initialize and use the SDK as per the docs. Unhandled exceptions are also captured automatically by Sentry, and you can add external methods as needed via the rescript JS API. The only issue here is that Rescript does not support sourcemaps - which means there is no way to associate the minified JS error to the original rescript file in a production error stacktrace. See rescript-lang/rescript#1699 for more details. This means Sentry (and other production error monitoring) can never give you the original stacktrace from rescript. I would recommend reaching out to the current ReScript maintainers - maybe they've changed their mind on supporting sourcemaps? I don't think the team has the bandwidth to maintain a set of Rescript bindings for the SDK, but anyone is free to help step in here - PRs are welcome! We can help review PRs and give feedback! |
Beta Was this translation helpful? Give feedback.
-
Going to transfer this as a discussion since we need more input on this. |
Beta Was this translation helpful? Give feedback.
-
Problem Statement
Rescript is a new and rapidly developing programming language. But has no support in sentry
Solution Brainstorm
Add support for Rescript
Beta Was this translation helpful? Give feedback.
All reactions