英文:
Why is SignalR throwing an error that doesn't provide any information?
问题
I can provide a translation of the non-code part:
在SignalR中出现以下错误。
不应该抛出任何错误。我们没有收到任何错误消息。它只说出现了错误。但是关于出现了什么错误呢?
错误:无法启动传输'WebSockets':错误:出现传输错误。错误:无法启动传输'ServerSentEvents':错误:发生错误。错误:带有错误'Error'的连接断开连接。错误:无法启动传输'LongPolling':错误signalr.js:4741 WebSocket连接至'wss://tst.com/SignalRHub?id=ujZbbgfwN2nbPvjGTIpGBw'失败:[2023-05-22T12:36:24.679Z] 错误:无法启动连接:错误:无法连接到任何可用的传输方式。WebSockets失败:错误:出现传输错误。ServerSentEvents失败:错误:发生错误LongPolling失败:错误
所有错误同时发生。
不应该抛出任何错误。
英文:
Getting below errors in SignalR.
It should not throw any errors. We are not getting any Error messages. It only says Error. But what not about what error occurred?
> Error: Failed to start the transport 'WebSockets': Error: There was an
> error with the transport. Error: Failed to start the transport
> 'ServerSentEvents': Error: Error occurred Error: Connection
> disconnected with error 'Error'. Error: Failed to start the transport
> 'LongPolling': Error signalr.js:4741 WebSocket connection to
> 'wss://tst.com/SignalRHub?id=ujZbbgfwN2nbPvjGTIpGBw' failed:
> [2023-05-22T12:36:24.679Z] Error: Failed to start the connection:
> Error: Unable to connect to the server with any of the available
> transports. WebSockets failed: Error: There was an error with the
> transport. ServerSentEvents failed: Error: Error occurred LongPolling
> failed: Error
new signalR.HubConnectionBuilder()
.withUrl(window.location.origin+\"/SignalRHub\", { skipNegotiations: true})
.withAutomaticReconnect([0, 0, 10000])
.configureLogging(signalR.LogLevel.Information)
.build()
All errors are coming at the same time.
It should not throw any errors.
答案1
得分: 0
根据您的描述和评论,有时它可以工作,所以我相信在这种情况下没有代码问题。
您可以首先查看官方文档以检查404错误。
我们可以正确启用粘性会话来解决此问题。
英文:
According your description and comment, it sometime works, so I believe there is no code issue in this case.
You can follow the official doc to check the 404 error first.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论