-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Problem
Raygun.Blazor v2.0.1 depends on KristofferStrube.Blazor.Window v0.1.0-alpha.7, which
transitively pulls in KristofferStrube.Blazor.WebIDL v0.6.0. These alpha-quality
packages cause recurring JS interop errors in production, particularly on iOS/Safari:
Error 1: formatError null reference
Microsoft.JSInterop.JSException: null is not an object (evaluating 'error.name')
formatError@/_content/KristofferStrube.Blazor.Window/KristofferStrube.Blazor.Window.j
s:11:21
Error 2: Stack overflow during error conversion
RangeError: Maximum call stack size exceeded
The WebIDL library enters infinite recursion when converting JS errors to .NET
exceptions on iOS devices.
Error 3: Null JSObjectReference
Cannot create a JSObjectReference from the value 'null'
Occurs when error.error is null due to cross-origin or iOS security policies.
Impact
The irony is that the error monitoring SDK itself is generating errors that need to
be filtered out. We've had to add multiple client-side filters in our Blazor app to
suppress these, which defeats the purpose of having error monitoring.
Suggestion
Consider one of:
- Remove the KristofferStrube.Blazor.Window dependency - use direct IJSRuntime calls
for the Window API surface you need (likely minimal) - Add null guards in the JS interop layer before calling error.name / error.message
on potentially null error objects - Pin to a stable release once KristofferStrube publishes one (currently alpha for
over a year)
Environment
- Raygun.Blazor: 2.0.1
- .NET: 10.0
- Blazor WebAssembly
- Primarily affects iOS/Safari, but also seen on other browsers