dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.66k stars 417 forks source link

SignalR client (js) does not receive messages from hub when running through Aspire app host #4563

Open jornhd opened 3 months ago

jornhd commented 3 months ago

We have an application that has Vue 3 frontend, a BFF (.NET8) and a backend API (.NET8 WebApi). The API has a SignalR message hub and sends messages to the Vue client. We've used Project Tye to run this solution locally with great success, and now we wanted to migrate to Aspire. The migration went well, all the components runs fine and works together, except that the SignalR client stopped receiving messages. The server (api) is set to send messages on certain events, and the client is set to receive these messages with connection.on("<messageType>", data) It seems to connect to the hub. The "negotiate" call (https) gets a response, but the next call using wss never gets a response. We've tried to change to both LongPolling and ServerSentEvent. Both seems ok, meaning that the network calls all gets 200, but the client never gets the messages from the server. This was no problem prior to adding Aspire app host. Does anyone have an idea of how this problem can be solved?

mitchdenny commented 3 months ago

If possible could you put together a minimal repro and post it up to GitHub so we can clone it down and take a look.

davidfowl commented 3 months ago

Putting this in 8.1. There are several issues people have reported with SignalR that we need to investigate.

jornhd commented 2 months ago

I'm working on a repro. The minimal one (without access token) worked fine, so I need to add auth and possibly more until I get the error. But this takes time I don't really have, so it could be a while to get it done.

jornhd commented 2 months ago

Accidently closed.