Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
After deploying a new version of an Angular application to an SWA instance and visiting the URL, requests seem to intermittently be routed to either the old or new version of the SWA causing hashed JS and CSS bundles to be missing/trigger the navigationFallback rule to rewrite response to index.html
To Reproduce
Steps to reproduce (intermittent):
Deploy new version of app
Vist app URL
Inspect network log to see that the index.html is the correct/latest version referencing the latest bundles but at random one or more of the bundles have triggered the navigationRewrite rule and are populated with the previous index.html instead of the expected js/css
Notes:
This seems to only happen for about a minute after deployment - leading me wonder if this is a delay propagating the location of the new deployment across the SWA(or front door) infrastructure?
I'm aware this should also have an exclude files clause - which would prevent these from being re-written to index.html - however it doesn't seem like adding this would fix the high level issue and instead would just return 404's for the files? If this is not the case, and this would actually fix the issue for some reason it would be good to understand why. (ie if the missing files didn't trigger the fallback rule would the SWA infrastructure then check elsewhere for them (and find them) rather than immediately return a 404 to the browser?)
Expected behaviour
After deploying a new build, a user trying to access the app should be able to do so without any issues loading the assets.
After deploying a new version of an Angular application to an SWA instance and visiting the URL, requests seem to intermittently be routed to either the old or new version of the SWA causing hashed JS and CSS bundles to be missing/trigger the navigationFallback rule to rewrite response to index.html
To Reproduce Steps to reproduce (intermittent):
Notes:
This seems to only happen for about a minute after deployment - leading me wonder if this is a delay propagating the location of the new deployment across the SWA(or front door) infrastructure?
My navigation fallback rule looks like this:
I'm aware this should also have an exclude files clause - which would prevent these from being re-written to index.html - however it doesn't seem like adding this would fix the high level issue and instead would just return 404's for the files? If this is not the case, and this would actually fix the issue for some reason it would be good to understand why. (ie if the missing files didn't trigger the fallback rule would the SWA infrastructure then check elsewhere for them (and find them) rather than immediately return a 404 to the browser?)
Expected behaviour After deploying a new build, a user trying to access the app should be able to do so without any issues loading the assets.