lexand
lexand•5mo ago

Deno Oak : Can't connect to SSE with Deno Deploy

Hello, I'm trying to deploy an app who use Server Sent Events. The goal is to keep in memory differents rooms and users when connected. Actually, i can see rooms being created and users being connected. I store the data of the room in a service but when i try to dispatchMessage on my users to send data, i see in my logs : user.target.dispatchMessage is not a function Locally, i don't get this errors. It works perfectly fine. I add some picture of the code that could help. Here is the repo : https://github.com/silvanic/PlanningPoking Thanks a lot for you help !
GitHub
GitHub - silvanic/PlanningPoking
Contribute to silvanic/PlanningPoking development by creating an account on GitHub.
No description
No description
5 Replies
NDH
NDH•5mo ago
I't may help to mention that this is an Oak server.
lexand
lexand•5mo ago
Yes, sorry. There you go, i mention it in the title
NDH
NDH•5mo ago
I'd love to help, but have no Oak experience. Someone will help.
lexand
lexand•5mo ago
Well, I have what... 1 month of experience on Oak as a side project? I'm just picking up information here and there to make things up and try to improve little by little. but thanks for reading 🙂
lexand
lexand•5mo ago
[UPDATE] : i change from EventEmitter (to trigger the dispatchEvent) to a setInterval. That's a bit better, i can connect but it seems SSE doesn't send back data on Deno Deploy, it returns 404 which is strange. Maybe the Free tier doesn't allow that?
No description