Context:
I am using module federation plugin to load a remote app. A user is able to click a button and be routed to that remote application.
My issue is when the remote app goes down right before they click the button, it causes a weird state / chunkload errors. The only way to stop this is to refresh the page to avoid that weird state. Currently I can use window.addeventlistener to listen for errors when I navigate, but this is an issue because I dont know when to remove the listener (ideally it would be if i knew that the navigate was successful), but that is proving to be difficult
Just looking for advice on how to deal with this scenario or a more elegant solution