When deploying an Angular SPA to a SWA instance, sometimes (maybe 10% chance – not reliably reproducible) for a short time after deploying it appears that some of the JS bundles are temporarily missing.
The way I’m getting to this conclusion is a little bit convoluted:
The config for this application has a navigation fallback rule to rewrite to index.html but is missing a exclude clause for files. So this is obviously a issue that needs to be addressed, but what’s happening is sometimes for up to a couple minutes after deploying a new build, some of the js files are returned to the browser containing the contents of the index.html (target of the navigation fallback rule) – after this brief period of time it sorts itself out and the JS is returned and everything is fine after that and there are no issues until a future build is deployed.
So my question is:
Is the navigation fallback rule being triggered for these files because they are missing? And so adding the exclude clause would just end up giving a 404 instead? Which is preferable but where are they?
Or is there some other explanation why these requests would only temporarily hit the fallback rule right after a deployment despite not being missing?
Will definitely be updating the config to exclude other files from the fallback rule but really would like to understand exactly what is going on here especially since it’s an intermittent issue.