Not entirely sure why this hasn't surfaced before and why it's happening now to me (using Vite), but it looks in some situations the hot.dispose runs a bit late and, because mapUpdate replaces hmrState no matter whether the program is active or not, in the next update the Inactive state is loaded and Elmish freezes.
Only saving hmrState for active programs seem to fix this.
Not entirely sure why this hasn't surfaced before and why it's happening now to me (using Vite), but it looks in some situations the
hot.dispose
runs a bit late and, becausemapUpdate
replaces hmrState no matter whether the program is active or not, in the next update theInactive
state is loaded and Elmish freezes.Only saving hmrState for active programs seem to fix this.