ant-design-blazor / ant-design-charts-blazor

A Blazor chart library, based on G2Plot
https://ant-design-blazor.github.io/ant-design-charts-blazor/
Apache License 2.0
172 stars 39 forks source link

The NuGet package AntDesign.Charts V0.2.3 does not work #81

Open SongPing opened 2 years ago

SongPing commented 2 years ago

There seem to be no "ant-design-charts-blazor.js" deployed.

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not find 'AntDesignCharts.interop.create' ('AntDesignCharts' was undefined).
      Error: Could not find 'AntDesignCharts.interop.create' ('AntDesignCharts' was undefined).
          at https://localhost:5001/_framework/blazor.webassembly.js:1:328
          at Array.forEach (<anonymous>)
          at a.findFunction (https://localhost:5001/_framework/blazor.webassembly.js:1:296)
          at _ (https://localhost:5001/_framework/blazor.webassembly.js:1:2437)
          at https://localhost:5001/_framework/blazor.webassembly.js:1:3325
          at new Promise (<anonymous>)
          at Object.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.webassembly.js:1:3306)
          at Object.St [as invokeJSFromDotNet] (https://localhost:5001/_framework/blazor.webassembly.js:1:59853)
          at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.5.fliom2fq3z.js:1:195300)
          at wasm://wasm/00971e46:wasm-function[219]:0x1a490
Microsoft.JSInterop.JSException: Could not find 'AntDesignCharts.interop.create' ('AntDesignCharts' was undefined).
Error: Could not find 'AntDesignCharts.interop.create' ('AntDesignCharts' was undefined).
    at https://localhost:5001/_framework/blazor.webassembly.js:1:328
    at Array.forEach (<anonymous>)
    at a.findFunction (https://localhost:5001/_framework/blazor.webassembly.js:1:296)
    at _ (https://localhost:5001/_framework/blazor.webassembly.js:1:2437)
    at https://localhost:5001/_framework/blazor.webassembly.js:1:3325
    at new Promise (<anonymous>)
    at Object.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.webassembly.js:1:3306)
    at Object.St [as invokeJSFromDotNet] (https://localhost:5001/_framework/blazor.webassembly.js:1:59853)
    at _mono_wasm_invoke_js_blazor (https://localhost:5001/_framework/dotnet.6.0.5.fliom2fq3z.js:1:195300)
    at wasm://wasm/00971e46:wasm-function[219]:0x1a490
   at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16`1[[Microsoft.JSInterop.Infrastructure.IJSVoidResult, Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at AntDesign.Charts.ChartComponentBase`1.<Create>d__58[[AntDesign.Charts.LineConfig, AntDesign.Charts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at AntDesign.Charts.ChartComponentBase`1.<OnAfterRenderAsync>d__55[[AntDesign.Charts.LineConfig, AntDesign.Charts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
SinnoSong commented 2 years ago

@SongPing Do you link the static files in wwwroot/index.html ?Please add this code in your index.html file.

<script src="https://unpkg.com/@antv/g2plot@latest/dist/g2plot.min.js"></script>
<script src="_content/AntDesign.Charts/ant-design-charts-blazor.js"></script>