Crypter icon indicating copy to clipboard operation
Crypter copied to clipboard

[Bug] BlazorSodium doesn't load with .NET 9.0.102

Open ibede opened this issue 11 months ago • 4 comments

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:

Image

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

ibede avatar Feb 12 '25 05:02 ibede

Confirmed.

Jack-Edwards avatar Feb 12 '25 15:02 Jack-Edwards

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

Jack-Edwards avatar Feb 12 '25 16:02 Jack-Edwards

<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.

Jack-Edwards avatar Feb 12 '25 20:02 Jack-Edwards

Marek's suggestion to disable build compression in the .csproj and re-enable compression as a publish option should work as well.

Jack-Edwards avatar Feb 14 '25 04:02 Jack-Edwards