Completed
Last Updated: 29 Mar 2021 09:36 by ADMIN
Release 2.23.0
Scott
Created on: 06 Nov 2020 08:17
Category: Tooltip
Type: Bug Report
8
Microsoft.JSInterop.JSException with Telerik Tooltip under IOS

I am getting the following error with them *only* when loading my site on an iPhone, after the page had been previously loaded on a PC.

2020-11-02T16:19:51.547Z] Error: Microsoft.JSInterop.JSException: An exception occurred executing JS interop: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.. See InnerException for more details.
 ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.
 ---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
   at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value)
   at System.Text.Json.Utf8JsonReader.GetDouble()
   at System.Text.Json.Serialization.Converters.JsonConverterDouble.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.HandleNull(Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadValueCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadValueCore(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at Microsoft.JSInterop.JSRuntime.EndInvokeJS(Int64 taskId, Boolean succeeded, Utf8JsonReader& jsonReader)
   --- End of inner exception stack trace ---
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Telerik.Blazor.Components.TelerikTooltip.OnAfterRenderAsync(Boolean firstRender)

5 comments
Sander Soots
Posted on: 08 Feb 2021 10:12
Similar error different use case. Have a filterable list of say 1k items, that have tooltips on buttons that are on the same row with them. When you are filtering, it crashes sooner or later with this stack trace, eerily similar to the reported bug.

blazor.server.js:19 [2021-02-05T14:21:41.497Z] Error: Microsoft.JSInterop.JSException: An exception occurred executing JS interop: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.. See InnerException for more details.
 ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.
 ---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
   at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value)
   at System.Text.Json.Utf8JsonReader.GetDouble()
   at System.Text.Json.Serialization.Converters.DoubleConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCoreAsObject(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadValueCore[TValue](JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.Deserialize(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at Microsoft.JSInterop.JSRuntime.EndInvokeJS(Int64 taskId, Boolean succeeded, Utf8JsonReader& jsonReader)
   --- End of inner exception stack trace ---
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Telerik.Blazor.Components.TelerikTooltip.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
ADMIN
Kristian
Posted on: 26 Jan 2021 15:04

Hello Jason,

I tried to reproduce the problem defining the following tooltip:

 

<TelerikTooltip TargetSelector="@("#" + PropertyName + "help")">
</TelerikTooltip>

<span id="@(PropertyName + "help")" class="HelpLink" tabindex="0">
    Test tooltip
    <i class="bi bi-question-circle-fill mx-2"></i>
</span>

@code {
    public string PropertyName { get; set; } = "test";
} 

 

but I didn't manage to do it.

Can you please share a complete setup of your tooltip, as well as the hosting model you are using (and the latency if you are using the server-side model)?

 

Regards,
Kristian
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jason
Posted on: 20 Jan 2021 04:47

I'm getting this error too. I have my TelerikTooltip in a component. There seems to be a race condition happening as it does not always happen. In my case the TargetSelector is:

TargetSelector="@("#" + PropertyName + "help")"

 

and then the target looks like:

<span id="@(PropertyName + "help")" class="HelpLink" tabindex="0">
    <i class="bi bi-question-circle-fill mx-2"></i>
</span>
ADMIN
Joana
Posted on: 30 Nov 2020 07:34

Hello Hando,

Could you plese elaborate more on the scenario? How have you configured the tooltip and what is its TargetSelector?

I tested an integration with TelerikWindow and everything seems to be working fine on my end. However, note that we bind the show events to the target elements once the Tooltip is initialized, so the elements should be present on the page to assure that everything works as expected.

Regards,
Joana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hando
Posted on: 23 Nov 2020 16:04
Having the same error with a TelerikTooltip on a TelerikWindow when the Visible property of the TelerikWindow is set to false. It is not an IPhone issue for us. Tested on Chrome and Firefox on a Windows laptop.

Currently the issue seems limited to one use case in our application. In other situations with TelerikToolip on a TelerikWindow the issue does not seem to occur.