Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor WASM Error on iOS Safari - RangeError: Out of Memory #79909

Closed
1 task done
kyletinsley opened this issue Dec 22, 2022 · 8 comments
Closed
1 task done

Blazor WASM Error on iOS Safari - RangeError: Out of Memory #79909

kyletinsley opened this issue Dec 22, 2022 · 8 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono

Comments

@kyletinsley
Copy link

kyletinsley commented Dec 22, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When loading Blazor WASM apps in iOS Safari, the following error is encountered, causing all apps to fail to load:
RangeError: Out of memory

I've encountered this error in every app I've written. To ensure the issue was not within my code, I created a new project using the standard WASM template in VS (counter/weather) and made no modifications.
image

I then deployed the default/unmodified app to Azure and repeated my testing. The error is encountered randomly when refreshing Safari on iOS (about every 5th refresh). I've experienced this on multiple iPhones and verified on BrowserStack using several iOS devices and Safari versions.

Here's the deployed base app:
https://blazor7-test.azurewebsites.net

This is s screenshot I took from BrowserStack:
2022-12-22_10-08-30

Expected Behavior

App should load successfully, as it does in other browsers.

Steps To Reproduce

  1. Using the standard .NET7 Blazor WebAssembly project template, create a new project.
  2. Deploy that app to Azure app services.

Exceptions (if any)

RangeError: Out of Memory

.NET Version

7.0.100

Anything else?

No response

@javiercn javiercn transferred this issue from dotnet/aspnetcore Dec 22, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Dec 22, 2022
@marek-safar marek-safar added the arch-wasm WebAssembly architecture label Dec 22, 2022
@ghost
Copy link

ghost commented Dec 22, 2022

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?

  • I have searched the existing issues

Describe the bug

When loading Blazor WASM apps in iOS Safari, the following error is encountered, causing all apps to fail to load:
RangeError: Out of memory

I've encountered this error in every app I've written. To ensure the issue was not within my code, I created a new project using the standard WASM template in VS (counter/weather) and made no modifications.
image

I then deployed the default/unmodified app to Azure and repeated my testing. The error is encountered randomly when refreshing Safari on iOS (about every 5th refresh). I've experienced this on multiple iPhones and verified on BrowserStack using several iOS devices and Safari versions.

Here's the deployed base app:
https://blazor7-test.azurewebsites.net

This is s screenshot I took from BrowserStack:
2022-12-22_10-08-30

Expected Behavior

App should load successfully, as it does in other browsers.

Steps To Reproduce

  1. Using the standard .NET7 Blazor WebAssembly project template, create a new project.
  2. Deploy that app to Azure app services.

Exceptions (if any)

RangeError: Out of Memory

.NET Version

7.0.100

Anything else?

No response

Author: kyletinsley
Assignees: -
Labels:

arch-wasm, untriaged, area-VM-meta-mono

Milestone: -

@pavelsavara
Copy link
Member

I see var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||536870912 in the dotnet.js, this is probably duplicate of #61925

@pavelsavara
Copy link
Member

@kyletinsley
What does your dotnet workload list print ?

@pavelsavara pavelsavara removed the untriaged New issue has not been triaged by the area owner label Jan 16, 2023
@kyletinsley
Copy link
Author

image

@pavelsavara
Copy link
Member

pavelsavara commented Jan 17, 2023

@kyletinsley
could you please build/publish your project with -bl and share with me the binlog ?
Also please check what value INITIAL_MEMORY has, search inside your dotnet*.js

I'm trying to understand what triggers the re-link for you.
I could not reproduce it on vanilla blazor template.
Are you passing some MSBuild switches on commandline ? Or adding them to the .csproj in your real project ?

Update: I figured it out, thanks!

@pavelsavara
Copy link
Member

Now I understand, just the installation of the wasm-tools workload always triggers re-link and you get.

Compiling native assets with emcc with -Oz. This may take a while ...
...
Linking for initial memory $(EmccInitialHeapSize)=536870912 bytes

@pavelsavara
Copy link
Member

Now I understand, just the installation of the wasm-tools workload always triggers re-link and you get.

@radical @lewing
I think we should not change behavior of the build just by installing the workload.
I would rather have people also opt in via some msbuild property.
What do you think ?

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 19, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 8, 2023
@pavelsavara
Copy link
Member

Fixed by #80849

@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Projects
None yet
Development

No branches or pull requests

3 participants