runtime: Blazor Wasm dotnet 8 preview 6 doesn't work on chrome android phone

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When running even the default blazorwasm template, it work on desktop browser, but when accessed from a chrome brwoser on android, error

Expected Behavior

No response

Steps To Reproduce

Create a default project, dont edit anything dotnet new blazorwasm

Run it dotnet run

Open in desktop browser, everything is fine https://localhost:5001

Ngrok to the same pc ngrok http localhost:5001

Access ngrok url from same desktop, everything works fine https://5fb8-41-217-56-136.ngrok-free.app/

Access the same ngrok url from chrom on android, doesnt work https://5fb8-41-217-56-136.ngrok-free.app/

blazor.webassembly.js:1  instantiate_wasm_module() failed: {}
Et @ blazor.webassembly.js:1
blazor.webassembly.js:1  Stacktrace: 

Et @ blazor.webassembly.js:1
blazor.webassembly.js:1  CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
Et @ blazor.webassembly.js:1
2dotnet.js:3  CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
U @ dotnet.js:3
dotnet.js:3  Error in mono_download_assets: CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
(anonymous) @ dotnet.js:3
dotnet.js:3  CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
U @ dotnet.js:3
blazor.webassembly.js:1  Error: Failed to start platform. Reason: CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
    at zt (blazor.webassembly.js:1:54482)
    at async Gt (blazor.webassembly.js:1:56202)
(anonymous) @ blazor.webassembly.js:1
4dotnet.js:3  Uncaught (in promise) CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
dotnet.runtime.8.0.0-preview.6.23329.7.uvxzzeohdi.js:3  Uncaught (in promise) CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189
25fb8-41-217-56-136.ngrok-free.app/:1  Uncaught (in promise) CompileError: WebAssembly.instantiateStreaming(): Compiling function dotnet/aspnetcore#112:"mono_wasm_load_runtime" failed: Invalid opcode 0xfd (enable with --experimental-wasm-simd) @+32189

image

Exceptions (if any)

No response

.NET Version

8.0.100-preview.6.23330.14

Anything else?

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 5
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Firstly, I appreciate the hard work you’re doing on this project!

I encountered the error I posted above while trying to access the application on iOS 16.3.1, utilizing both the built-in Safari browser and Google Chrome version 114.0.5735.1254.

To provide you with a bit more context, I have been running a .NET 7.0 WebAssembly application in production since February. The application is publicly accessible and is used across a variety of devices, which, understandably, are not within my control. Interestingly, my analytics data suggest that many of my visitors are still using older iOS devices and browser versions - there’s a significant number of iOS 15.x devices, with some using iOS 13 and 14 as well.

So far, the application has been functioning smoothly on these devices with .NET 7.0. However, I’m concerned that the WASM SIMD requirement in .NET 8.0 may render the application inaccessible for those using older iOS versions.

Would it be possible to make the SIMD requirement configurable? So we would have the flexibility to decide whether we wish to require SIMD in our .NET 8.0 applications or instead fallback to the previous approach employed in .NET 7.0.

Update: I wanted to add that after updating my iPhone to the latest available version, iOS 16.5.1, I was able to use the WASM components without any issues on both browsers. However, as I noted earlier, there’s a significant proportion of users still operating on older iOS versions, and unfortunately, their update cycles aren’t something we can control.

I hope this feedback is helpful and I look forward to your thoughts.

@hankovich A second property WasmBuildNative needs to be set to true, it triggers rebuild of native code. It happens automatically when you publish the app.

@tn-5 You can publish the app twice and than use loadBootResource and in combination with SIMD detection mentioned here https://github.com/dotnet/runtime/issues/84574#issuecomment-1634603894 you can choose between published versions during blazor startup

It does not only affect users with older browsers. It also affects users with the latest browsers running on very old hardware where the CPU does not support SIMD. In our Blazor line of business app we have several thousand users of which a couple of hundred are affected by this. For now we had to revert to the server side version for them but obviously it is not feasible in the long run to do this. We either need:

  • A way to completely disable SIMD in our builds; or
  • To dynamically detect SIMD support properly and to not use SIMD in those cases