I am getting error in browser console
Project version is .NET 9
Template Blazor Web App Auto Interactive Render
@rendermode @(new InteractiveWebAssemblyRenderMode(false)) after setting data not get loaded and error still there. why data is not get loaded pre render false state?
blazor.web.js:1
ManagedError: One or more errors occurred. (Object reference not set to an instance of an object.)
at sn (marshal-to-js.ts:420:18)
at Kt.resolve_or_reject (marshal-to-js.ts:315:28)
at marshal-to-js.ts:363:16
at marshal-to-js.ts:341:48
at fr (invoke-js.ts:523:9)
at Fc (marshal-to-js.ts:341:5)
at dotnet.native.3c4wvb350q.wasm:0x1f1a4
at dotnet.native.3c4wvb350q.wasm:0x1c8ae
at dotnet.native.3c4wvb350q.wasm:0xea19
at dotnet.native.3c4wvb350q.wasm:0x1ec88
callEntryPoint @ blazor.web.js:1
await in callEntryPoint
Hr @ blazor.web.js:1
await in Hr
Fr @ blazor.web.js:1
startWebAssemblyIfNotStarted @ blazor.web.js:1
resolveRendererIdForDescriptor @ blazor.web.js:1
determinePendingOperation @ blazor.web.js:1
refreshRootComponents @ blazor.web.js:1
(anonymous) @ blazor.web.js:1
setTimeout
rootComponentsMayRequireRefresh @ blazor.web.js:1
onDocumentUpdated @ blazor.web.js:1
Hi @ blazor.web.js:1
here is my code
@page "/list"
@inject IDiseaseService _diseasesService
@* @rendermode @(new InteractiveWebAssemblyRenderMode(false)) *@
@rendermode @(new InteractiveWebAssemblyRenderMode(true))
<h3>List</h3>
@if (diseases is not null)
{
@foreach (var item in diseases.Items)
{
@item.Name
<br />
}
}
@code {
PagedResult<Disease> diseases = new();
protected override async Task OnInitializedAsync()
{
var result = await _diseasesService.Get(1, 10, string.Empty, 0);
if (result?.Value != null)
{
diseases = result.Value;
}
}
}