Problem using static web assets to reference themes

I have a Blazor Server application that creates column charts using Syncfusion.  The app works fine if link to Syncfusion-Blazor.min.js using CDN:

<script src=https://cdn.syncfusion.com/blazor/22.1.38/syncfusion-blazor.min.js type="text/javascript"></script>

However, the bar charts do not render if I use static web assets:

<script src="_content.Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>

I have installed the Syncfusion.Blazor.Themes, .Charts and .Core NuGet packages, and I have included app.UseStaticFiles() in Program.cs.

Am I missing something regarding static web assets?


1 Reply

GV Gopalakrishnan Veeraraghavan Syncfusion Team July 14, 2023 02:25 PM UTC

Hi Dennis,


We have analyzed your query and found that the static web assets issue may arise due to setting an incorrect path in the src attribute of a script in the _Host.cshtml file. It is important to ensure that the path is properly referenced in the src attribute in the _Host.cshtml file to avoid such rendering issues. We have attached a sample and screenshot for your reference. Please check with the below code snippet.

  

<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>



Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ScriptReferenceIssue468102242.zip


Screenshot:

A screenshot of a graph

Description automatically generated



Kindly revert us if you have any concerns.


Regards,

Gopalakrishnan Veeraraghavan


Loader.
Up arrow icon