I used ng build --prod to product ethe dist folder locally then I created a storage account in azure and turned on "Static App" Then I uploaded the contents of dist/xxx folder to $web folder but when I navigate to any route I get
[![enter image description here][1]][1]
things I tried
- set $web to blob(anonymous) access
- added file staticwebapp.config.json at same level where package.json is and build and uploaded the files again to container
- used routes.json file
for staticwebapp.config files i used following
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/images/*.{png,jpg,gif}", "/css/*"]
}
}
and
{
"navigationFallback": {
"rewrite": "index.html",
"exclude": ["/images/*.{png,jpg,gif}", "/css/*"]
}
}
and
{
"navigationFallback": {
"rewrite": "index.html"
}
}
Normally when others having similar issue they are able to navigate to a page and when they refresh they see this problem. but in my case i get this error as soon as i navigate first. [1]: https://i.stack.imgur.com/EqV2L.png