0

Built a fresh ionic v5 app from blank template. Added minimal logic to the home page for a simple toy project and deployed to a static blob on Azure.

Copied www folder to a blob and then made it public. Surf to the URL of index.html but this produced many errors of runtime.js:1 Failed to load resource: the server responded with a status of 400 (One of the request inputs is out of range.)

So then I tried a fresh storage module and used the 'static website` option and that does work except... when it runs, it adds /home to the address and if the user tries to refresh the page then it fails with The requested content does not exist. because of course it thinks that's a resource inside the site.

You can simulate this by running a server (eg. http-server) inside the www folder, run the app then refresh with F5. I notice there is no problem when running using the dev command ng serve

Older ionic projects didn't have this problem. Have I done something peculiar? This prevents any mobile phone from viewing the app and then adding to home screen because it includes the /home in the address.

Petebr
  • 155
  • 1
  • 7
  • has anybody experienced this issue? it's a bit of a deal breaker to not be able to use ionic 5 as a PWA framework. – Petebr Mar 17 '21 at 09:56

1 Answers1

0

Have found a partial solution here https://stackoverflow.com/a/56584151/769427

which describes using the 404 page setting of a static website to point at index.html. It does make it work (and with deep linking too) but the disadvantage is that a 404 error is registered each time in the dev tools.

Petebr
  • 155
  • 1
  • 7