Syncfusion CSS doesn't load on new Blazor Wasm application

Hello everyone,
I'm trying out Syncfusion on Blazor for the first time but unfortunately I cannot set up my project.
Here's what I do:
  1. Create Blazor WASM .Net 5.0 project
  2. Add Syncfusion.Blazor NuGet package
  3. In Program.cs on the Client project - Add builder.Services.AddSyncfusionBlazor();and register my license key
  4. Add necessary namespaces to_Imports.razor
  5. In wwwroot/index.html -Add to the element  the following line  

  1. Create new page with the following code:


  1. Run the app and navigate to /calendar-syncfunction
  2. Get this as a result:


See that the .css file is not present in the _content folder:

Any help would be appreciated

12 Replies 1 reply marked as answer

BC Berly Christopher Syncfusion Team November 19, 2020 12:55 PM UTC

Hi Danail, 
  
Greetings from Syncfusion support. 
  
We have checked the reported issue by creating the WASM application in .NET 5.0 project. Unfortunately, the reported issue is not occurred at our end and the Calendar component is rendered correctly. We suggest you to make ensure that CSS file is correctly referred in the project. 
  
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" /> 
 
  
Screenshot: 
 

  
  
Regards, 
Berly B.C 



ST Stefan December 30, 2020 08:17 PM UTC

I have the exact same problem with the DataGrid.
On the first page load the "_content/Syncfusion.Blazor.Themes" files are not loaded (can be seen in the Developer Tools of the browser).

When refreshing the page, the Themes are loaded and everything works as expected.

Probably this only happens when using the "hosted" wasm project template, where the client app is loaded via the server app.

I attached a small sample solution to reproduce the issue under the Counter page.

Attachment: SyncfusionTheme_a11d8222.zip


BC Berly Christopher Syncfusion Team December 31, 2020 08:45 AM UTC

Hi Stefan,   
  
Thanks for sharing the sample.   
  
Query: “On the first page load the "_content/Syncfusion.Blazor.Themes" files are not loaded (can be seen in the Developer Tools of the browser).”  
  
We have validated the reported query at our end by opening the provided sample at our end. We are not able to reproduce the reported issue at our end. For your convenience, we have prepared a video demonstration while running the project from visual studio   
  
  
We suggest you to ensure the reported issue by clearing the browser cache and Nuget cache. Please get back to us with more details, if you are still facing the reported issue.   
  
Regards,   
Berly B.C 


Marked as answer

DA Danail December 31, 2020 08:48 AM UTC

Stefan, 
When I was having the issue it was the exact same situation as yours. The CSS files would not load until the first page reload. Unfortunately I wasn't able to fix the issue in my current project. 
However, creating a brand new "hosted" WASM project fixed the issue. 


ST Stefan December 31, 2020 09:31 AM UTC

Thanks for the video and the reply, clearing the browser cache did fix the problem! 👍

thx!


BC Berly Christopher Syncfusion Team January 4, 2021 07:34 AM UTC

Hi Stefan, 
  
We are glad to know that your issue is resolved. Please let us know if you need further assistance on this. 
  
Regards, 
Berly B.C 



VM Vaidas Mikalajunas January 9, 2021 03:21 PM UTC

But it did not help for me (clearing browser and nuget cache) - the same ugly Calendar look... Also, I did not understand your video - you showed that css is loaded and working, then you clear cache and again showed, that css is working the same way as before clearing cache - so what is the point of this video? :). Worked only with  material.css


BC Berly Christopher Syncfusion Team January 11, 2021 01:29 PM UTC

Hi Vaidas, 
  
We have checked the WASM project with other available themes by using the local files from the _content folder and online CDN link. In both ways Calendar control is rendered correctly. Please find the other available theme’s path in the index.html. 
  
So, we suggest you to ensure the style URL is correctly referred in your application as mentioned any one of the below ways. 
  
Local Files: 
  
Material theme: 
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/material.css" rel="stylesheet" /> 
 
Bootstrap themes: 
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap.css" rel="stylesheet" /> 
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" /> 
Fabric theme: 
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/fabric.css" rel="stylesheet" /> 
Highcontrast theme: 
  <link rel='nofollow' href="_content/Syncfusion.Blazor/styles/highcontrast.css" rel="stylesheet" /> 

  
CDN Link: 
  
Material theme: 
<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.4.33/styles/material.css" rel="stylesheet" /> 
Bootstrap themes: 
<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.4.33/styles/bootstrap4.css" rel="stylesheet" /> 
<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.4.33/styles/bootstrap.css" rel="stylesheet" /> 
Highcontrast theme: 
<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.4.33/styles/highcontrast.css" rel="stylesheet" /> 
Fabric theme: 
<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.4.33/styles/fabric.css" rel="stylesheet" /> 
 
  
  
Regards, 
Berly B.C 



TA TARIK August 17, 2021 03:24 PM UTC

Hello,


This issue happend with me, and i know why, so this could be helpfull for the others.

The css file is not loaded at the first time, simply because you have another bootstrap <link> with the same rel ("stylesheet").

So it's using another css file, instead of the syncfusion's. Just remove th


much love,




BC Berly Christopher Syncfusion Team August 18, 2021 10:11 AM UTC

Hi Danail, 
  
Thanks for the update. 
  
Regards, 
Berly B.C 



BM Brent Minder replied to Berly Christopher October 31, 2021 02:42 PM UTC

@Berly Christopher

Those links didn't work with redundant "rel" attributes. I removed the first one ('nofollow') and left the 'stylesheet' one, only then did they work for me.

Thanks.



BC Berly Christopher Syncfusion Team November 1, 2021 06:52 AM UTC

Hi Brent, 
  
Thanks for the information. Please let us know if you need further assistance on this. 
  
Regards,  
Berly B.C 


Loader.
Up arrow icon