runtime: .NET 8 Preview 7 Blazor WebAssembly PWA, not working on iPhone & iPad
Description
After upgrading a .NET 7 Blazor WebAssembly PWA application to .NET 8 Preview 7 I noticed the web app stopped loading on iPhones and iPads. The console log shows the below error:
[Error] Error: AggregateException_ctor_DefaultMessage (Arg_IndexOutOfRangeException) — dotnet.runtime.8.0.0-preview.7.23375.6.hh1fgtyrm9.js:3:29648
(anonymous function) (blazor.webassembly.js:1:40595)
While attempting to create a sample, I discovered the two lines of code that reproduce the bug. The sample project with README.md instructions can be found here: https://github.com/atuggle/BlazorWebAssemblyPWA-BreaksOnIOS
- Build and deploy the above repository to duplicate it on iPhone
- The repo has 2 commits, the second commits are the breaking changes that must both be added
Configuration
There are two steps to reproduce this and it’s pretty easy. Step 1 create a sample Blazor WebAssemby PWA project, and Step 2 add two lines of code deploy, and verify on iPhone it does not work.
Step 1: Create the project
- Open Visual Studio 2022 Preview Edition
- Choose “New Project” to create a new project
- Find and choose “Blazor WebAssembly App”
- Name the App and choose “Next”
- Ensure “.NET 8.0 (Preview)” is selected as the framework and check “Progressive Web Application”
Step 2: Add code that breaks it on iPhone & iPad
- Turn on AOT by adding
<RunAOTCompilation>true</RunAOTCompilation> to the project file - Add an <InputText …/> element in the index.razor page
<InputText id="emailText" class="form-control" /> - Deploy the above code and see it fails on IOS with the error
Other information
I am able to work around this right now by turning AOT off, and most people will not notice this because AOT is off by default for most new project creations.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 19 (9 by maintainers)
FYI, Chrome and Firefox on iPhone/iPad are just Safari in a wrapper. So you don’t need to test with them.
@kg
Your suggestion to add the
BlazorWebAssemblyJiterpreterhas no impact. I tested it both ways with the valuesfalseandtrueand if AOT was set to True it did not work, but if AOT was set to False the site worked (again it worked with bothfalseandtrueset forBlazorWebAssemblyJiterpreter)Safari will not allow me to copy the stack trace so the following screen captures show the stack trace:

I don’t have any apple device, so I just tested the provided repository with chrome on windows. I get
Also, this is compiled with SIMD instructions and perhaps your devices doesn’t have recent version of Safari (16.4 and above) ?