We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid - blazor preview 8 - latest syncfusion package - Client side blazor

I'm trying to just bind a list of the WeatherForecast (default blazor template) the Grid in a Client side blazor app that calls an ordinary REST get method. I can see that the objects are returned but I just get the "progress icon" and the following error (I tried the same from server side blazor project and no issue):

This is the code:
    <EjsGrid DataSource="@forecasts" AllowPaging="true">
        <GridPageSettings PageCount="5"></GridPageSettings>
        <GridColumns>
            <GridColumn Field=@nameof(WeatherForecast.Summary) HeaderText="Summary" TextAlign="TextAlign.Left" Width="120"></GridColumn>
        </GridColumns>
    </EjsGrid>


This is the error:

Uncaught (in promise) Error: System.NullReferenceException: Object reference not set to an instance of an object.
  at System.Linq.EnumerableRewriter.FindEnumerableMethod (System.String name, System.Collections.ObjectModel.ReadOnlyCollection`1[T] args, System.Type[] typeArgs) <0x3eb09b0 + 0x000b0> in <fe050c2c735c46059c45daa7bea399be>:0
  at System.Linq.EnumerableRewriter.VisitMethodCall (System.Linq.Expressions.MethodCallExpression m) <0x3ea90a0 + 0x00140> in <fe050c2c735c46059c45daa7bea399be>:0
  at System.Linq.Expressions.MethodCallExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) <0x3e97888 + 0x0000c> in <fe050c2c735c46059c45daa7bea399be>:0
  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) <0x2cbde20 + 0x00018> in <fe050c2c735c46059c45daa7bea399be>:0
  at System.Linq.EnumerableQuery`1[T].GetEnumerator () <0x3ea1500 + 0x00022> in <fe050c2c735c46059c45daa7bea399be>:0
  at System.Linq.EnumerableQuery`1[T].System.Collections.IEnumerable.GetEnumerator () <0x3ea1240 + 0x00004> in <fe050c2c735c46059c45daa7bea399be>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter writer, System.Collections.IEnumerable values, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x2dd8610 + 0x000a6> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x2d46fe8 + 0x001d6> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x2ebd648 + 0x0013a> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) <0x2d46fe8 + 0x0018c> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x2c3a788 + 0x000e6> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x2c375e8 + 0x00540> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) <0x2c36ce0 + 0x00014> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) <0x2bec728 + 0x00060> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.Formatting formatting, Newtonsoft.Json.JsonSerializerSettings settings) <0x2f091a0 + 0x0002c> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, Newtonsoft.Json.Formatting formatting, Newtonsoft.Json.JsonSerializerSettings settings) <0x2f090e8 + 0x0000e> in <12891e825fce44a581e5bbbb579c1d49>:0
  at Syncfusion.EJ2.Blazor.BaseComponent.DataProcess (System.String dataManager, System.String key) <0x3e785c8 + 0x00368> in <bb9b141e9b8e4c2aaac23f2dbe27e604>:0
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x2438208 + 0x000d2> in <66ea9b39e1e746d2b4249543530555e0>:0
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.JSInterop.DotNetDispatcher.InvokeSynchronously (System.String assemblyName, System.String methodIdentifier, System.Object targetInstance, System.String argsJson) <0x32683a8 + 0x00118> in <30781c3ac5104a4783ec7e7411267cbe>:0
  at Microsoft.JSInterop.DotNetDispatcher.BeginInvoke (System.String callId, System.String assemblyName, System.String methodIdentifier, System.Int64 dotNetObjectId, System.String argsJson) <0x3268058 + 0x0009c> in <30781c3ac5104a4783ec7e7411267cbe>:0
    at Object.endInvokeDotNetFromJS (http://localhost:52284/_framework/blazor.webassembly.js:1:7057)
    at Object.invokeJSFromDotNet (http://localhost:52284/_framework/blazor.webassembly.js:1:6683)
    at _mono_wasm_invoke_js_marshalled (http://localhost:52284/_framework/wasm/mono.js:1:176158)
    at wasm-function[6316]:382
    at wasm-function[1952]:138
    at wasm-function[602]:5007
    at wasm-function[602]:6744
    at wasm-function[602]:6027
    at wasm-function[602]:6027
    at wasm-function[602]:6744

1 Reply

RS Renjith Singh Rajendran Syncfusion Team August 23, 2019 03:17 PM UTC

Hi BigMac, 
 
Greetings from Syncfusion. 
 
Query: script error throws while getting data using GetJsonAsync method 
 
We have validated your query and we are able to reproduce the reported problem at our end. You can resolve the reported problem by adding the below code in application.csproj file(within PropertyGroup tag). Please find the below code example and sample for your reference. 
 
[code example] 
  <PropertyGroup> 
    <TargetFramework>netstandard2.0</TargetFramework> 
    <LangVersion>7.3</LangVersion> 
    <RazorLangVersion>3.0</RazorLangVersion> 
    <BlazorLinkOnBuild>false</BlazorLinkOnBuild> 
  </PropertyGroup> 
 
 
The reported issues are discussed in the below links. Please find the below links for your reference. 
 
                              https://github.com/mono/mono/issues/12917 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



Loader.
Live Chat Icon For mobile
Up arrow icon