[Bug] BlazorSodium doesn't load with .NET 9.0.102
Describe the bug Due to the upgrade of Microsoft.AspNetCore.Components.WebAssembly.DevServer to 9.0.1 in PR #760, local debugging environment needed to be upgraded to the latest .NET 9 patch version. Since then Chrome cannot load the BlazorSodium bundle. As a result only the header and footer parts are visible in Crypter.Web. Downgrading to .NET 9.0.0 and also the DevServer component works. Affects development only.
To Reproduce Steps to reproduce the behavior:
- Try to run Crypter.Web locally with .NET 9.0.102
Expected behavior The user interface is usable
Screenshots Chrome Dev tab shows the following error:
Environment (please complete the following information):
- Device: Desktop
- OS: Windows 10 22H2
- Browser: Chrome 132, Firefox 135
Additional context Maybe related to this BlazorSodium issue
Confirmed.
It's something to do with the static compression of the blazorSodium.js file.
Fails: https://localhost:5001/_content/BlazorSodium/blazorSodium.bundle.js Explicit GZ works: https://localhost:5001/_content/BlazorSodium/blazorSodium.bundle.js.gz Explicit BR works: https://localhost:5001/_content/BlazorSodium/blazorSodium.bundle.js.br
<CompressionEnabled>false</CompressionEnabled> in the .csproj gets things working again.
Not sure when I'll have more time to investigate this properly. Could be a change I need to make on BlazorSodium.
Marek's suggestion to disable build compression in the .csproj and re-enable compression as a publish option should work as well.