Blazor Server events not triggering when hosted behind Cloudflare

Are you hosting your Blazor Server app behind Cloudflare? Are you having issues with events not triggering? Check your configuration 😉.
📅 15 Aug 2023

Symptoms

  • You are using Blazor Server
  • Hosting your application behind Cloudflare proxied traffic
  • No events are triggering in your blazor app

Solution

The solution is luckily quite simple (once you know 😅)

From the Cloudflare dashboard select your domain
Figure: From the Cloudflare dashboard select your domain

Navigate to Speed | Optimization | Content Optimization | Auto Minify and untick HTML
Figure: Navigate to Speed | Optimization | Content Optimization | Auto Minify and untick HTML

Once HTML is switched off for minification, everything should work as expected.

Credit: Brendan Sluke on the StackOverflow post c# - Blazor onclick event not triggered - Stack Overflow