You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I try to build a webgl package and display it on a web page, the stack cannot be displayed. Is there any step that is not executed?
And Does it support crash log capture for webgl? When I enter the crash command of unity, there is no log capture.
Captures and reports exceptions but misses stacktrace.
Full Without Stacktrace
Captures and reports exceptions but misses stacktrace.
Full With Stacktrace
Captures and reports exception and provides a stacktrace (albeit with no line numbers due to lack of IL2CPP backend availability)
Failing to create a new StackTrace
This is happening when setting to Explicitly Thrown Exceptions Only and Full Without Stacktrace.
The SDK fails trying to create a new SentryStackTrace the SDK fails with Could not resolve stack frame. This is due to the DebugStackTrace failing to create a managed frame. It relies on the following snippet used in the AotHelper
var stackTrace = new StackTrace(false);
return stackTrace.GetFrame(0)?.GetMethod() is null;
To resolve this we could provide our own dedicated WebGLStackTraceFactory to create a new frame and fall back on stackFrame.ToString() instead of doing nothing. And probably skip a whole lot of other, for WebGL unnecessary checks i.e.
if (CreateFrame(stackFrame) is { } frame)
{
yield return frame;
}
else
{
yield return new SentryStackFrame { Function = stackFrame.ToString() };
}
LogError events missing stacktrace
The missing stacktrace also mentioned in #2091 (comment) is also related to the PlayerSettings.WebGL.exceptionSupport. When setting to FullWithStacktrace the SDK is able to provide stacktraces for these events as well. Set to any other option Unity does not pass down a stacktrace to the logging integration and we'd need to create a new stacktrace, bringing us back to the point above.
Recommendation
The current recommendation is to set PlayerSettings.WebGL.exceptionSupport to Full With Stacktrace to get the most out of the SDK. Anything else will require us to build a WebGL specific integration to better handle those cases.
Activity
bruno-garcia commentedon Apr 2, 2025
It does support webgl. but wechat specifically I'm not sure. could you try and let us know?
dryyy27 commentedon Apr 7, 2025
But when I try to build a webgl package and display it on a web page, the stack cannot be displayed. Is there any step that is not executed?
And Does it support crash log capture for webgl? When I enter the crash command of unity, there is no log capture.
bitsandfoxes commentedon Apr 8, 2025
Can you provide a sample for us to look at? When running the SDK's sample game, I do see the stack trace getting reported.
dryyy27 commentedon Apr 9, 2025
Demo: https://github.com/dryyy27/SentryDemo.git.
I deleted the dsn, auth, project and organization.
When I switch the platform to Linux or Android, the stack can be displayed
47 remaining items
bitsandfoxes commentedon May 2, 2025
I'll have to try and check the conditions under which we can reliably grab and parse the stacktrace and then put together a PR.
bitsandfoxes commentedon May 5, 2025
So after digging through it there are two issues tied to the `exceptionSupport:
PlayerSettings.WebGL.exceptionSupportLimitationsNoneNot supported. See #2141 for more details.
Explicitly Thrown Exceptions OnlyCaptures and reports exceptions but misses stacktrace.
Full Without StacktraceCaptures and reports exceptions but misses stacktrace.
Full With StacktraceCaptures and reports exception and provides a stacktrace (albeit with no line numbers due to lack of IL2CPP backend availability)
Failing to create a
new StackTraceThis is happening when setting to
Explicitly Thrown Exceptions OnlyandFull Without Stacktrace.The SDK fails trying to create a new
SentryStackTracethe SDK fails withCould not resolve stack frame. This is due to the DebugStackTrace failing to create a managed frame. It relies on the following snippet used in the AotHelperTo resolve this we could provide our own dedicated
WebGLStackTraceFactoryto create a new frame and fall back onstackFrame.ToString()instead of doing nothing. And probably skip a whole lot of other, for WebGL unnecessary checks i.e.LogErrorevents missing stacktraceThe missing stacktrace also mentioned in #2091 (comment) is also related to the
PlayerSettings.WebGL.exceptionSupport. When setting toFullWithStacktracethe SDK is able to provide stacktraces for these events as well. Set to any other option Unity does not pass down a stacktrace to the logging integration and we'd need to create a new stacktrace, bringing us back to the point above.Recommendation
The current recommendation is to set
PlayerSettings.WebGL.exceptionSupporttoFull With Stacktraceto get the most out of the SDK. Anything else will require us to build a WebGL specific integration to better handle those cases.[-]The webgl platform cannot display stack information[/-][+]Improve stack trace when targeting `WebGL`[/+]bitsandfoxes commentedon Nov 12, 2025
Superseded by #2415