sentry-unity
sentry-unity copied to clipboard
Events not captured from Unity WebGL build after scene change
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 2.0.6
How did you install the package? (Git-URL, Assetstore) Git-URL
Which version of Unity? 2021.3.32f1
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? It is happening on WebGL build(dont know if on another platforms also, did not tested). In Editor bug is NOT reproduced
Steps to Reproduce
- Integrate Sentry SDK events/messages/errors/unhandledExceptions capturing on first and second scenes via SentrySdk.Capture[] methods.
- Capturing executed from UniTask loop in custom non MonoBehaviour classes.
- Make game build on WebGL platform(dev/usual, doesn't matter)
- Run build on any browser(tested on Chrome and Firefox, both reproduced bug).
Expected Result
All calls of SentrySdk.Capture[] methods and unhandled exceptions will be gathered and displayed on sentry.io.
Actual Result
While first scene is loaded and active all events sending to cloud correctly. But after a moment of second scene loaded all events stops to send. After this, each sending try throws NullReference exception to browser console from internal SentrySDK code(see the screenshots).
Exceptions thrown from internal DoSendEvent method and catched by try/catch block.
Any logs or screenshots
SentryConfiguration on which build was tested:
Detailed log of Error message: