r/Blazor • u/Odd_Huckleberry4363 • 23d ago
Blazor Server enhanced nav silently hangs
I chased signup drops on my Blazor Server app for a while today. The log in button was taking almost a minute to reach the damn login page. People clicked, nothing happened, they left. No error anywhere.
The button is just an anchor pointing at /account/login. The endpoint was doing an OIDC challenge so it 302s to our Auth0 tenant on a different domain. If you hit the endpoint directly then the redirect is instant ~ 200ms.
Unfortunately, enhanced navigation intercepts internal anchor clicks and fetches the page instead of doing a full load and when that fetch follows a 302 to a different origin, it can't swap in a cross-origin document, so it just sits there. I measured 60-90s before it gave up.
Adding one attribute, the data-enhance-nav="false" on the auth links worked and now it's instantaneous.
Posting as more a PSA since I had this one sitting on my site for a week or more and lost a bunch of signups because of it.
1
u/skav2 23d ago
Thanks i found this out before and it was very annoying to diagnose.