#Is there a better way to handle errors when my remote app goes down?

5 messages · Page 1 of 1 (latest)

static schooner
#

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

sharp sedge
#

you can create a health check service for your remote apps ... when one of them is down you can produce a side effect in your app such as disable a route button or display a warn/error message stuff like that

#

but make sure to avoid a large number of request cause you can create a DOS to your own application

static schooner
#

Would there be any way of doing this without making changes to the remote app?

sharp sedge
#

is it running on top of docker instance ?