Embedded error form not working when used with `tunnel` in JavaScript SDK
See original GitHub issueEnvironment
self-hosted (https://develop.sentry.dev/self-hosted/)
Version
22.2.0
Steps to Reproduce
- Use the latest official SDK with React &
tunnel
option - Enabled embedded feedback dialog in
ErrorBoundary
component
Expected Result
- Errors are reported through the
tunnel
endpoint (got this working through Django view, inspired by your Flask example) - Embedded form uses the
tunnel
endpoint to both load it’s JS & submit data.
Actual Result
1) The URL at which the SDK looks for the embedded form’s JavaScript is not configurable
I was able to go around this by fiddling with DSN value in options for the dialog, but that’s an ugly work-around since DSN is at this point about identification of org/project as opposed to anything with API location.
2) Cannot configure the submit
URL of embedded form
This is probably very much connected to the first problem, but even when I work around the first one, this one gets into my way… that is to say that I am able to get the form to show up, but it has the following additional problems:
2.1. Submit URL is based on the internal absolute URL
This doesn’t work in the context of my application, since that URL won’t be publicly available.
Also, as a sidenote, I’m sure it doesn’t also need to include all the GET parameters that got there from dialog options (I’m supplying all texts because I’d like to have them be part of our translation catalogs.
var endpoint = /**/"http://127.0.0.1:9000/api/embed/error-page/?dsn=http%3A%2F%2Fe691f5a9f573484a95e8da0ee4fe55e2%40127.0.0.1%3A3010%2F2&title=It+looks+like+we%E2%80%99re+having+issues.&subtitle=Our+team+has+been+notified.&subtitle2=If+you%27d+like+to+help%2C+tell+us+what+happened+below.+%E2%80%93+not+visible+on+small+screen+resolutions&labelName=Name&labelEmail=Email&labelComments=What+happened%3F&labelClose=Close&labelSubmit=Submit&errorGeneric=An+unknown+error+occurred+while+submitting+your+report.+Please+try+again.&errorFormEntry=Some+fields+were+invalid.+Please+correct+the+errors+and+try+again.&successMessage=Your+feedback+has+been+sent.+Thank+you%21&eventId=cd203fb8d8934d5f8390a9b29cab7e6a";/**/ '';
2.2. The embed JS is injected twice & the form itself shows twice as a result.
This might quite possibly stem from the fact that development mode of react re-throws errors it catches, but as far I was able to gather, the ErrorBoundary
component uses APIs from vanilla JS package.
There should be some kind of singleton sanity check around that JavaScript injection.
- I can gather & supply more information upon request.
- Even though the issue might seem like one with JavaScript/React SDK, the underlying logic is spread through the whole project, so I gathered that this repository should be the place to go.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Okay yeah I’m gonna bump this to the JavaScript SDK team to digest that. 😂
Thanks for the great info!
Hey @smeubank - @fisprak and others are looking for an update on when submitting user feedback from the user report dialogue via tunnel will be supported.