Blazor WASM (8.0 RC2) does not work on iOS 15.8
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
Blazor WASM application created from VS template (Blazor Web App, interactivity WebAssembly, per page) does not work on iOS 15.7 and 15.8 (tested on iPhone 6s). When I try to display "Counter" page I immediately see yellow message at the bottom of the page: Unhandled exception. Here is the screenshot from dev tools (iPhone connected to MacBook). Screenshot was made a few weeks ago, but I see exactly the same problem in .NET 8.0 RC2:
Exactly the same app works correctly on iOS 16.7.2 (iPhone 12 Pro Max) and Windows 11 (Firefox, Chrome, Edge) .NET 7 WASM application works on iOS 15.8.
iOS 15.8 (released a few days ago) is available for: iPhone 6s (all models), iPhone 7 (all models), iPhone SE (1st generation), iPad Air 2, iPad mini (4th generation), and iPod touch (7th generation) (source: https://support.apple.com/en-us/HT213990). According to this page https://developer.apple.com/support/app-store/ iOS 15.x is still popular.
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Issue Details
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
Blazor WASM application created from VS template (Blazor Web App, interactivity WebAssembly, per page) does not work on iOS 15.7 and 15.8 (tested on iPhone 6s). When I try to display "Counter" page I immediately see yellow message at the bottom of the page: Unhandled exception. Here is the screenshot from dev tools (iPhone connected to MacBook). Screenshot was made a few weeks ago, but I see exactly the same problem in .NET 8.0 RC2:
Exactly the same app works correctly on iOS 16.7.2 (iPhone 12 Pro Max) and Windows 11 (Firefox, Chrome, Edge) .NET 7 WASM application works on iOS 15.8.
iOS 15.8 (released a few days ago) is available for: iPhone 6s (all models), iPhone 7 (all models), iPhone SE (1st generation), iPad Air 2, iPad mini (4th generation), and iPod touch (7th generation) (source: https://support.apple.com/en-us/HT213990). According to this page https://developer.apple.com/support/app-store/ iOS 15.x is still popular.
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
| Author: | Andrzej-W |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
I guess SIMD, but the UX is not great
@Andrzej-W Can you please share what version of Safari do you have on iOS 15.7 and 15.8?
@maraf I'm not an iOS expert, but I think Safari on this system is an integral part of the operating system. According to this page https://developer.apple.com/documentation/safari-release-notes/safari-15_6-release-notes the newest Safari 15.x version is 15.6. iOS 15.7 and 15.8 was released to fix some security bugs only. My iPhone 6s has only official system updates and I believe I have Safari 15.6.
Support for WASM SIMD instructions was added in Safari 16.4 (https://developer.apple.com/documentation/safari-release-notes/safari-16_4-release-notes#WebAssembly).
Unfortunately I cannot disable SIMD in Blazor https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=windows#single-instruction-multiple-data-simd to retest the application.
Thanks for details.
You can disable SIMD (in Blazor) using <WasmEnableSIMD>false</WasmEnableSIMD> (>= .NET 8 RC2). The GH issue is open only for adding a CI test that disabling SIMD remains working. We will update the docs.
We are going to investigate why it shows manifests this way on iOS instead of the nicer error message we added and that works on older Chrome/FF
Thank you @maraf for the tip. I can confirm that after adding <WasmEnableSIMD>false</WasmEnableSIMD> Blazor WASM works on my old iPhone 6s.
Is it technically possible to check for WASM SIMD availability at runtime? It would be nice to have it enabled but fallback to standard instructions in older browsers.
I think runtime checking would be also useful to check if the WASM implementation has no bugs. Look here, please: https://developer.apple.com/documentation/safari-release-notes/safari-17_2-release-notes#WebAssembly iOS 17 is not available for iPhone 8 and iPhone X. Do people still use these iPhone models? The answer is probably yes.
We have such feature on our radar. It's slightly complicated because we have to build the app twice (and then select the correct version on runtime).
EDIT: https://github.com/dotnet/runtime/issues/78872
I tried to run iOS 15.5 in emulator and when the WASM app was compiled with SIMD enabled, I got a nice message "This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features".
@Andrzej-W Can you please validate with RC2 that the message you are getting is as bad as the one on the screenshot from RC1? Please make sure that because of stale cache or something you are not looking at a stale version of the app.
This issue has been marked needs-author-action and may be missing some important information.
Thank you @maraf for explanation. It looks #78872 has .NET 9 milestone assigned - I have to wait :(
I have disabled SIMD and now my problem is solved, but I don't close this issue because you have written:
We are going to investigate why it shows manifests this way on iOS instead of the nicer error message we added and that works on older Chrome/FF
Let's assume this nice error message will somehow appear on the screen. Will it be possible to localize it to other languages?
I have just noticed your last message - I will repeat my tests. Do you test locally on your Mac? I'm working on Windows 11 computer and my application was published to external server - it is release build.
Let's assume this nice error message will somehow appear on the screen. Will it be possible to localize it to other languages?
Are you asking from the developer point of view? In that case we open an issue to make them localized, but since you're the first one asking it's probably a very low priority.
If you want to show a message to the user, I would encourage you to do the SIMD check in your codebase and provide a message meaningful for the end user, because the messages we provide are developer oriented.
I have just noticed your last message - I will repeat my tests.
Appreciated!
Do you test locally on your Mac? I'm working on Windows 11 computer and my application was published to external server - it is release build.
Yes, locally. I wouldn't expect it to have any impact.
This issue has been marked needs-author-action and may be missing some important information.
I just created a new Blazor application and published it here: https://blazor.aspnet.pl/ Could you open it and select Counter from menu. On my iPhone 6s with iOS 15.8 I see "standard" Blazor error on yellow background "An unhandled error has occurred"
I have VS 2022 17.8.0 Preview 6.0. .NET SDK is 8.0.100-rc.2.23502.2
It looks that published application doesn't display nice error message on real device and on simulator. Here is the screenshot from iOS 15.5 simulator:
As I mentioned earlier, the "nice" message is meant for developer only. I'm interested if you see it in the devtools.
OK, now I understand what you mean. I can connect my iPhone to MacBook and then in Safari dev tools in console tab I see "nice" message about WASM SIMD. It looks that I can close this issue.
In the meantime I was thinking what to do with this "feature". Probably I will disable SIMD in my application because even the most beautiful message is useless for iPhone users. They cannot update Safari nor they can use any other modern browser. Should I display: Dear user, please buy a new iPhone, your old one is junk. This is probably an unacceptable user experience.
OK, now I understand what you mean. I can connect my iPhone to MacBook and then in Safari dev tools in console tab I see "nice" message about WASM SIMD. It looks that I can close this issue.
Exactly. It should only hint developers why it doesn't work. It has no value for end users.
In the meantime I was thinking what to do with this "feature". Probably I will disable SIMD in my application because even the most beautiful message is useless for iPhone users. They cannot update Safari nor they can use any other modern browser. Should I display: Dear user, please buy a new iPhone, your old one is junk. This is probably an unacceptable user experience.
Disabling SIMD makes sense if you need support customers with older hardware. An alternative is to implement the side-by-side SIMD and non-SIMD app versions yourself and which between them before the Blazor app starts until we provide it in the box.
Hmm, not sure if I should open a new issue. I got this issue on Safari (16.3) for macOS after upgrading to .NET 8. But setting WasmEnableSIMD to false just gives me another error:
I also tried setting WasmBuildNative to true without any luck. This is a bit critical, do I have to downgrade again?
@mwarvik Second problematic feature with Safari is typically Wasm Exception Handling, can you please try setting <WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>? Also, isn't any cache involved?
@maraf Thanks for the answer. If I set <WasmEnableExceptionHandling>false</WasmEnableExceptionHandling>, the blazor-error-ui is not displayed, but the same error is still displayed in the console (and there are various issues with running the app).
I have tried clearing the cache, with no change in behavior.