Blazor-ApexCharts icon indicating copy to clipboard operation
Blazor-ApexCharts copied to clipboard

Getting Javascript Error on latest Beta

Open endeffects opened this issue 3 years ago • 5 comments

I'm getting the following Javascript Error when i try to use the latest beta version. Any ideas?

dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[1]
      Initializing component 7 (Microsoft.AspNetCore.Components.CascadingValue`1[ApexCharts.ApexChart`1[TestProject.Shared.Point]]) as child of 6 (ApexCharts.ApexChart`1[TestProject.Shared.Point])
dbug: Microsoft.AspNetCore.Components.RenderTree.Renderer[3]
      Rendering component 7 of type Microsoft.AspNetCore.Components.CascadingValue`1[ApexCharts.ApexChart`1[TestProject.Shared.Point]]
Uncaught TypeError TypeError: Cannot read properties of null (reading 'length')
    at value (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\apex-charts.min.js:7:38069)
    at value (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\apex-charts.min.js:15:40784)
    at <anonymous> (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\apex-charts.min.js:7:5274)
    at <anonymous> (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\apex-charts.min.js:15:39933)
    at value (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\apex-charts.min.js:15:24478)
    at renderChart (C:\Users\xxx\.nuget\packages\blazor-apexcharts\0.9.12-beta\staticwebassets\js\blazor-apex-charts.js:258:15)
    at <anonymous> (https://localhost:5001/_framework/blazor.webassembly.js:1:3332)
    at beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.webassembly.js:1:3306)
    at St (https://localhost:5001/_framework/blazor.webassembly.js:1:59853)
    at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:195300)
    at $func219 (undefined:1:106748)
    at $func167 (undefined:1:51914)
    at $func166 (undefined:1:47581)
    at $func2810 (undefined:1:703267)
    at $func1615 (undefined:1:457014)
    at $func1619 (undefined:1:458659)
    at $mono_wasm_invoke_method (undefined:1:38556)
    at Module._mono_wasm_invoke_method (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:219002)
    at managed_BINDINGS_SetTaskSourceResult (https://mono-wasm.invalid/managed_BINDINGS_SetTaskSourceResult:17:40)
    at <anonymous> (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:154643)
    --- Promise.then ---
    at _wrap_js_thenable_as_task (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:154624)
    at _js_to_mono_obj (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:167065)
    at js_to_mono_obj (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:163037)
    at receiveHotReload (https://localhost:5001/_framework/blazor-hotreload.js:2:18)
    at St (https://localhost:5001/_framework/blazor.webassembly.js:1:60049)
    at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:195300)
    at $func219 (undefined:1:106748)
    at $func167 (undefined:1:51914)
    at $func166 (undefined:1:47581)
    at $func2810 (undefined:1:703267)
    at $func1615 (undefined:1:457014)
    at $func1619 (undefined:1:458659)
    at $mono_wasm_invoke_method (undefined:1:38556)
    at Module._mono_wasm_invoke_method (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:219002)
    at managed__Microsoft_AspNetCore_Components_WebAssembly__Microsoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS (https://mono-wasm.invalid/managed__Microsoft_AspNetCore_Components_WebAssembly__Microsoft_AspNetCore_Components_WebAssembly_Services_DefaultWebAssemblyJSRuntime_EndInvokeJS:16:40)
    at endInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.webassembly.js:1:42114)
    at <anonymous> (https://localhost:5001/_framework/blazor.webassembly.js:1:3371)
    --- Promise.then ---
    at beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.webassembly.js:1:3358)
    at St (https://localhost:5001/_framework/blazor.webassembly.js:1:59853)
    at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:195300)
    at $func219 (undefined:1:106748)
    at $func167 (undefined:1:51914)
    at $func166 (undefined:1:47581)
    at $func2810 (undefined:1:703267)
    at $func1615 (undefined:1:457014)
    at $func1619 (undefined:1:458659)
    at $mono_wasm_invoke_method (undefined:1:38556)
    at Module._mono_wasm_invoke_method (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:219002)
    at managed_BINDINGS_SetTaskSourceResult (https://mono-wasm.invalid/managed_BINDINGS_SetTaskSourceResult:17:40)
    at <anonymous> (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:154643)
    --- Promise.then ---
    at _wrap_js_thenable_as_task (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:154624)
    at _js_to_mono_obj (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:167065)
    at js_to_mono_obj (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:163037)
    at Fe._internal.getSatelliteAssemblies (https://localhost:5001/_framework/blazor.webassembly.js:1:38765)
    at St (https://localhost:5001/_framework/blazor.webassembly.js:1:60049)
    at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:195300)
    at $func219 (undefined:1:106748)
    at $func167 (undefined:1:51914)
    at $func166 (undefined:1:47581)
    at $func2810 (undefined:1:703267)
    at $func1615 (undefined:1:457014)
    at $func1619 (undefined:1:458659)
    at $mono_wasm_invoke_method (undefined:1:38556)
    at Module._mono_wasm_invoke_method (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:219002)
    at _call_method_with_converted_args (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:183515)
    at call_method (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:181988)
    at <anonymous> (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:188673)
    at call_assembly_entry_point (https://localhost:5001/_framework/dotnet.6.0.4.dckq00jdfr.js:1:188906)
    at callEntryPoint (https://localhost:5001/_framework/blazor.webassembly.js:1:43472)
    at At (https://localhost:5001/_framework/blazor.webassembly.js:1:59564)
    --- await ---
    at <anonymous> (https://localhost:5001/_framework/blazor.webassembly.js:1:60917)
    at <anonymous> (https://localhost:5001/_framework/blazor.webassembly.js:1:61017)
    <ApexChart @ref="this.Chart" Title="Test" Options="this.Options" TItem="Point">
        
        <ApexPointTooltip>
            <div class="m-2">
                @{
                    var point = (ListPoint<Point>) context.DataPoint;

                    <h3>@point.X</h3>
                    <span class="me-1">Min:@point.Y?.Min()</span>
                    <span class="me-1">Max:@point.Y?.Max()</span>
                    <span class="me-1">Avg:@point.Y?.Average()</span>
                    <span class="me-1">Count:@point.Y?.Count()</span>

                }
            </div>
        </ApexPointTooltip>
        
        <ChildContent>
            @foreach (var source in this.Points.GroupBy(point => point.Price))
            {
                <ApexPointSeries TItem="Point"
                                 Items="source.OrderBy(point => point.Time)"
                                 Name="@source.Key.ToString(CultureInfo.InvariantCulture)"
                                 SeriesType="SeriesType.Heatmap"
                                 XValue="@(e => e.Time)"
                                 YValue="@(e => Convert.ToDecimal(e.Fiat))" />
            }
        </ChildContent>

    </ApexChart>

endeffects avatar Jun 18 '22 18:06 endeffects

Hello,

Not sure..

Do you still get the error if you remove the custom tooltip?

joadan avatar Jun 21 '22 13:06 joadan

I got the same error, what is this custom tooltip?

kiranmaya avatar Jul 06 '22 11:07 kiranmaya

The <ApexPointTooltip>..

Is it possible share a repo with this error? If so I can look into it right away.

joadan avatar Jul 06 '22 11:07 joadan

working fine in newly created project. something is wroung with main my project,it has mudblazor package. will update the issue , tonight. Screenshot_1

kiranmaya avatar Jul 06 '22 12:07 kiranmaya

Everything working fine, that error must some mis sync of hot reload.

kiranmaya avatar Jul 06 '22 13:07 kiranmaya