Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4840

How to resolve error: "Could not find 'ChartJsInterop.setupChart'" - When using ChartJsBlazor

$
0
0

Im trying to use ChartJsBlazor with my Blazor WebAssemply project in Visual Studio and I've pretty must just copied the guide from the "Getting Started" section (https://github.com/mariusmuntean/ChartJs.Blazor).

But when I run it, i get this error in the browser:"blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]Unhandled exception rendering component: Could not find 'ChartJsInterop.setupChart' ('ChartJsInterop' was undefined).Error: Could not find 'ChartJsInterop.setupChart' ('ChartJsInterop' was undefined)...."

Im using the NuGet packet ChartJs.Blazor.Fork (2.0.2) - And I've added the static assets to my index.html like this:"

<body><div id="app"><svg class="loading-progress"><circle r="40%" cx="50%" cy="50%" /><circle r="40%" cx="50%" cy="50%" /></svg><div class="loading-progress-text"></div></div><div id="blazor-error-ui">        An unhandled error has occurred.<a href="." class="reload">Reload</a><span class="dismiss">🗙</span></div><script src="_framework/blazor.webassembly.js"></script><script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script><script src="_content/ChartJs.Blazor.Fork/ChartJsBlazorInterop.js"></script></body>

My razor page code i just a replica of the "Getting startet" PieChart configuration. I have verified using the developer tool in the browser that the "ChartJsBlazorInterop.js" exists, but its empty...

I've followed the "Getting started guide step up step and i just wont work! What am I missing?I've tried adding the static assets in different orders but with no succes.

Essential the issue is: That the browser downloads an empty version of the Script "ChartJsBlazorInterop.js", when its expected to download a functional "ChartJsBlazorInterop.js" script - So the Chart can render.


Viewing all articles
Browse latest Browse all 4840

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>