Simple SfGrid not working in WebAssembly page

I followed the steps in
datagrid / how-to / client-side-using-visual-studio /
And I added a very simple grid to my test project (all very simple).
Just to avoid any 'contamination', I create the list of local orders to visualize them, so I just ended up with this code:
Where in the code I simply have:
public class Order
{
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
public List Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
But whatever I try, I always get this error:
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Cannot read property 'querySelector' of null
TypeError: Cannot read property 'querySelector' of null
(I had to remove the rest of the error because it contains urls that cannot be inserted in this message...)

...and I cannot even imagine what it can be... :-(
Could anyone help, please?
Thank you in advance.
Andrea

3 Replies

AB Andrea Bioli September 12, 2020 08:15 AM UTC

I can add some more information, since I tried with previous versions of the library:

18.2.0.48 All works perfectly, not even warnings.
18.2.0.54 No errors, but continuously 'L: GC_MINOR: (Nursery full) time 5.46ms, stw 5.47ms promoted 1307K major size: 264960K in use: 258899K los size: 1024K in use: 36K'
18.2.0.55 No errors, but grid not working and same continuous GC_MINOR messages
18.2.0.56 and 18.2.0.57 The described error.

So now I'm starting to think that there has been just some regression problem, in the code, but, again, it's really strange that the samples work fine...
I will use for the moment version .48, it's not a big problem, for me, but I'm curious to see what the problem is...

Thanks again



AB Andrea Bioli September 12, 2020 08:16 AM UTC

...unless the samples on your web site only use Server versions of Blazor applications...


RN Rahul Narayanasamy Syncfusion Team September 14, 2020 12:53 PM UTC

Hi Andrea, 
 
Greetings from Syncfusion. 
 
Query: Unhandled exception rendering component: Cannot read property 'querySelector' of null TypeError: Cannot read property 'querySelector' of null 
 
We have validated your query and could you please share the below details. It will be helpful to validate and provide a better solution. 
 
  • Whether did you bind the Grid with auto-generated columns? If yes, we have already logged an issue for this. Please confirm whether the same case did you used in your sample.
  • Full Grid code snippets.
 
Query: L: GC_MINOR: (Nursery full) time 5.46ms, stw 5.47ms promoted 1307K major size: 264960K in use: 258899K los size: 10 
 
Regarding this problem, could you please share the below details. It will be helpful to validate the problem and provide a better solution. 
 
  • Did you faced this problem at initial rendering itself? Or while navigating between pages?
  • Please share your sample (or) code snippet with full configurations.
 
Regards, 
Rahul 
 


Loader.
Up arrow icon