HMR gets stuck when frontend is connected to SSE endpoint using PubSub/Stream
hey, I'm still kinda new to Effect and I tried looking for a solution for a while (here, on the docs and in the effect repo) but I couldnt figure this one out
I think the solution is probably to use the
PubSub.shutdown
PubSub.shutdown
(or
awaitShutdown
awaitShutdown
?) in a finalizer somewhere, but even after adding those in different places I couldnt get it working :(
Issue
saving a backend file (which triggers the restart) doesnt work when FE is connected in SSE; tho whenever the tab is closed the process resume as expected
Restarting './src/main.ts'Waiting for graceful termination...# this never ends
Restarting './src/main.ts'Waiting for graceful termination...# this never ends
- then visit http://localhost:5173/ - then try saving any src file in the backend folder, ex: ./back/src/http/demo.live.ts - see the issue ("Waiting for graceful termination...")
-> commenting line 9 of ./front/src/App.tsx fixes the issue: