Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
621 views
in Technique[技术] by (71.8m points)

Blazor wasm hosted keeps loading Blazor app when their is a controller action to deal with page on the server side

I'll try and explain my problem. So its Blazor wasm hosted (Client and Server projects). I'm hoping to have a mixture of some pages that are served up by the server using MVC controller actions and also the Blazor app that deals with everything else.

I have a page /heat-maps/351 There is a controller action that deals with this request, the Blazor app won't do anything with that url.

So in a browser where I have already been on the Blazor app if I go to {my-domain}/heat-maps/351 (in a new tab) then it doesn't serve up the proper page it just loads the Blazor app and says page can't be found.

If i go to that same url {my-domain}/heat-maps/351 in a different broswer where I haven't already gone to the blazor app then it works as intended, the controller action kicks in and the page generated on the server is shown.

question from:https://stackoverflow.com/questions/65900673/blazor-wasm-hosted-keeps-loading-blazor-app-when-their-is-a-controller-action-to

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It turns out the problem I was having is because the app is an offline PWA and there is a service worker intercepting the requests and serving up a cached copy of index.html instead of making a request to the server for urls that I intended to be served by the server.

When I removed PWA from my Blazor web app (by following steps on below link) it solved my issue. Blazor Chrome caching issues


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...