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

  1. Open Visual Studio 2022 Preview Edition
  2. Choose “New Project” to create a new project
  3. Find and choose “Blazor WebAssembly App”
  4. Name the App and choose “Next”
  5. 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

  1. Turn on AOT by adding
    <RunAOTCompilation>true</RunAOTCompilation> to the project file
    
  2. Add an <InputText …/> element in the index.razor page
    <InputText id="emailText" class="form-control" />
    
  3. 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)

Most upvoted comments

Additional context: It doesn’t work in Chrome on my iPhone either. So both Safari & Chrome do not work when I have AOT = true on iPhone & iPad.

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 BlazorWebAssemblyJiterpreter has no impact. I tested it both ways with the values false and true and if AOT was set to True it did not work, but if AOT was set to False the site worked (again it worked with both false and true set for BlazorWebAssemblyJiterpreter)

Safari will not allow me to copy the stack trace so the following screen captures show the stack trace: image image image image

I don’t have any apple device, so I just tested the provided repository with chrome on windows. I get

image

Also, this is compiled with SIMD instructions and perhaps your devices doesn’t have recent version of Safari (16.4 and above) ?