Blazor Server - Random error occuring "The list of component records is not valid."
See original GitHub issueHi,
We’re using Asp.Net.Core 3.1.0, got a Blazor Server website.
Occasionally we get an error in the browser console saying:
blazor.server.js:15 [2020-01-06T11:22:02.989Z] Error: The list of component records is not valid.
But the trouble is I haven’t been able to work out why it appears, it seems like the signalr connection is being restarted as the console logs immediately before that line say:
[2020-01-06T11:22:02.785Z] Information: Normalizing '_blazor' to 'https://localhost:44303/_blazor'.
[2020-01-06T11:22:02.914Z] Information: WebSocket connected to wss://localhost:44303/_blazor?id=DpnlPPLrSkoFlbbF_TnHqg.
[2020-01-06T11:22:02.915Z] Information: Using HubProtocol 'blazorpack'.
I’ve got a feeling it’s when I’ve used the back button, but I haven’t been able to replicate the issue at all, it just randomly appears sometimes.
Can anybody give me a clue what could cause this issue? So i can try and manually replicate it?
The code that is throwing the error is in ComponentHub.StartCircuit, which looks to be called from the javascript function in CircuitManager.ts.startCircuit.
The javascript function is passing this parameter
JSON.stringify(this.components.map(c => c.toRecord())) which is what is causing the error to be thrown, but i’m not sure where this list of components is coming from?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Related StackOverflow Question
Hi, I have the same issue. I open blazor app, then I click back in browser to back google for example, on random time I click forward to back to blazor app. It’s very frustrating. Best!
Hi,
Thanks for the response.
We are not using multiple servers, and i’m pretty sure the site did not restart between.
I have slightly narrowed it down, It seems to happen most when i’m using NavigationManager.NavigateTo(“currentUrl”, true) to refresh the page completely, then hitting the back button.
However it doesn’t happen every time and I have still not been able to fully replicate the issue.
Thanks