Blazor in Azure: The list of component records is not valid

血红的双手。 提交于 2020-06-27 10:22:29

问题


When deploying our blazor app to azure, it fails four out of five times with this error (copied from chrome dev tools):

[2019-12-16T11:12:55.214Z] Information: Normalizing '_blazor' to 'https://example.com/_blazor'.
[2019-12-16T11:12:55.470Z] Information: WebSocket connected to wss://example-web-signalr-service.service.signalr.net/client/?hub=componenthub&asrs.op=%2F_blazor&negotiateVersion=1&asrs_request_id=...&id=...&access_token=...
[2019-12-16T11:12:55.548Z] Error: The list of component records is not valid.
    e.log @ blazor.server.js:15
    C @ blazor.server.js:8
    (anonymous) @ blazor.server.js:8
    (anonymous) @ blazor.server.js:1
    e.invokeClientMethod @ blazor.server.js:1
    e.processIncomingData @ blazor.server.js:1
    connection.onreceive @ blazor.server.js:1
    i.onmessage @ blazor.server.js:1
[2019-12-16T11:12:55.552Z] Information: Connection disconnected.
Uncaught (in promise) Error: Invocation canceled due to the underlying connection being closed.
    at e.connectionClosed (blazor.server.js:1)
    at e.connection.onclose (blazor.server.js:1)
    at e.stopConnection (blazor.server.js:1)
    at e.transport.onclose (blazor.server.js:1)
    at e.close (blazor.server.js:1)
    at e.stop (blazor.server.js:1)
    at e.<anonymous> (blazor.server.js:1)
    at blazor.server.js:1
    at Object.next (blazor.server.js:1)
    at a (blazor.server.js:1)

We can't make any sense out of this. What might be the cause for blazor to fail like this? Why doesn't it fail on our local developer machines? It is hard to find anything about this in google.

Please tell me if I need to provide more information. I am not sure which code snippets might be useful information.


回答1:


try this:

services.AddSignalR().AddAzureSignalR(options =>
{
    options.ServerStickyMode = Microsoft.Azure.SignalR.ServerStickyMode.Required;
});


来源:https://stackoverflow.com/questions/59355725/blazor-in-azure-the-list-of-component-records-is-not-valid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!