0

As an experiment, I wrote a blazor wasm app and it works fine on my development machine. In MS Visual Studio 2022, I published the solution to a folder. I then deployed it to Cloudflare pages by the drag and drop method. It worked great. Once. If I refresh, it doesn't work. If I do a new deployment, it doesn't work. If I go to a different computer, it works once. If I clear the cookies, it will work again. Once. Tried different browsers. Works once.

So to isolate the problem, I created the sample program that comes with Visual Studio: Blazor Web Assembly App. .Net7.0. Didn't change the code at all, just published to folder and copied the wwwroot folder. It behaves exactly the same way. Works once. testapp if you want to look at it. The error message from Chrome are that the webpage might temporarily be down or might have moved permanently.

When you publish to a folder you get a wwwroot folder, but you also get a web.config file. The Cloudflare pages documents says to copy just a folder. I am guessing that the web.config file somehow has a rule in it that says work more than once. /s Web.config is specific to IIS so I would think that Cloudflare wouldn't have any use for it.

There's one more clue. On Safari, if you refresh, you get a message saying Safari cannot open the page. The error was "Response Served by service worker has redirections".

Knox
  • 2,909
  • 11
  • 37
  • 65
  • i believe the reason for this is that a fallback route should be implemented that would ensure any route to the app goes to /index.html but i haven't done any testing and have abandoned this approach. – Knox Jan 24 '23 at 15:51

0 Answers0