Stack Overflow did not like my question so I am posting it here.
I have created a Blazor Server Website using .NET 8.
Forms and the localization do not work with AT&T Mobile Data. The site works with Verizon, T-Mobile, and WiFi. Has anyone else built a Blazor Server application that works on AT&T mobile data?
Here is the site: http://gregfinzer2-001-site3.ctempurl.com/
Here is the code: https://github.com/GregFinzer/BedBrigadeNational
To reproduce the issue, on the home page change from English to Spanish. On AT&T Mobile data it does not change to Spanish. On everything else, it works.
Here is what fails:
- Samsung S25+ with Chrome, Brave, Firefox, and Edge on AT&T Mobile Data fails
- Samsung S25 with Chrome on AT&T Mobile Data fails
- Samsung S21 on AT&T Mobile Data fails with Chrome (in Puerto Rico)
- Motorola G using Chrome with AT&T Mobile Data Hotspot Fails
- Samsung Tab A7 Lite on Chrome and AT&T Mobile Data Hotspot Fails
- Laptop on AT&T Mobile Data Hotspot Fails
These works:
- Desktop on WiFi
- Android on WiFi
- iPhone 16 Pro on WiFi
- Google Pixel 5 with Verizon Mobile Data
- Samsung S21 on T-Mobile Mobile Data
I have tried clearing the cache. The Motorola G was a brand new phone that I bought for testing and that did not work the first time. I have also tried the Chrome Inspect with the phone connected to my desktop PC. The inspect does not load at all. I also tried installing the DevTools for Firefox on Android. There are no console errors.
Another test is that if you click Bed Brigade near me, the search form is just completely missing with Android and AT&T mobile data. Anything else you will see a search form. Type in 43228 for the zip code to see the result.
New Information
I connected my laptop to the AT&T mobile data hotspot and now I am actually able to see an error in the Chrome developer tool console when the website loads: Uncaught (in promise) SyntaxError: Unexpected token '�', "�" is not valid JSON
I went through several different attempts at fixes with ChatGPT including changing it to only use WebSockets, attempting to use a _Host.cshtml in Blazor 8, and doing long polling.
Here is the conversation with ChatGPT: https://chatgpt.com/share/6851886e-1fb0-8005-a475-421c708d2a56
Here are the PRs with the attempted changes:
- https://github.com/GregFinzer/BedBrigadeNational/pull/514
- https://github.com/GregFinzer/BedBrigadeNational/pull/515
- https://github.com/GregFinzer/BedBrigadeNational/pull/516
- Answer
The problem was that the AT&T mobile data proxy was compressing the event stream. So I disabled the compression of the event stream and it worked:
//Add this right before builder.Services.AddServerSideBlazor
builder.Services.AddResponseCompression(options =>
{
// Exclude SSE so it's never compressed
options.MimeTypes = ResponseCompressionDefaults.MimeTypes
.Except(new[] { "text/event-stream" });
});
//Add this right before app.UseStaticFiles()
app.UseResponseCompression();
The problem was that the AT&T mobile data proxy was compressing the event stream. So I disabled the compression of the event stream and it worked:
//Add this right before builder.Services.AddServerSideBlazor
builder.Services.AddResponseCompression(options =>
{
// Exclude SSE so it's never compressed
options.MimeTypes = ResponseCompressionDefaults.MimeTypes
.Except(new[] { "text/event-stream" });
});
//Add this right before app.UseStaticFiles()
app.UseResponseCompression();
No comments:
Post a Comment