dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.91k stars 4.63k forks source link

[browser] Strip source map info when source maps are not copied to output folder #98288

Open rajshukla09 opened 7 months ago

rajshukla09 commented 7 months ago

Is there an existing issue for this?

Describe the bug

We have build a webassembly app

net8.0 enable

When working with chrome and microsoft edge, it works fine. But with safari , i get an error as Failed to load resource: the server responded with a status of 404 () _framework/dotnet.js.map for safari browser blazor web assembly

Expected Behavior

It should work fine with all browser.

Steps To Reproduce

Create the blazor webAssembly Run it Open it in safari browser

Exceptions (if any)

image

.NET Version

8

Anything else?

ghost commented 6 months ago

Tagging subscribers to this area: @thaystg 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 We have build a webassembly app net8.0 enable When working with chrome and microsoft edge, it works fine. But with safari , i get an error as Failed to load resource: the server responded with a status of 404 () _framework/dotnet.js.map for safari browser blazor web assembly https://www.sfurt.com/ ### Expected Behavior It should work fine with all browser. ### Steps To Reproduce one can browse and see in console for https://www.sfurt.com/ Create the blazor webAssembly Run it Open it in safari browser ### Exceptions (if any) ![image](https://github.com/dotnet/aspnetcore/assets/56117141/ed9e1f44-7e10-4b4e-974e-a1be6a687f91) ### .NET Version 8 ### Anything else? You can see the deployed code https://github.com/rajshukla09/sfurtlive
Author: rajshukla09
Assignees: -
Labels: `area-Debugger-mono`
Milestone: -
javiercn commented 6 months ago

@maraf I don't know if this is a safari thing or if this is the dotnet.runtime.js file including the source map link instead of making the source map private.

maraf commented 6 months ago

We don't trip the information about source maps for publish. Chromium based browsers report missing source map only as a warning when selecting the source in devtools, Safari shows it as an error

ghost commented 6 months ago

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 We have build a webassembly app net8.0 enable When working with chrome and microsoft edge, it works fine. But with safari , i get an error as Failed to load resource: the server responded with a status of 404 () _framework/dotnet.js.map for safari browser blazor web assembly https://www.sfurt.com/ ### Expected Behavior It should work fine with all browser. ### Steps To Reproduce one can browse and see in console for https://www.sfurt.com/ Create the blazor webAssembly Run it Open it in safari browser ### Exceptions (if any) ![image](https://github.com/dotnet/aspnetcore/assets/56117141/ed9e1f44-7e10-4b4e-974e-a1be6a687f91) ### .NET Version 8 ### Anything else? You can see the deployed code https://github.com/rajshukla09/sfurtlive
Author: rajshukla09
Assignees: -
Labels: `arch-wasm`, `untriaged`, `area-Build-mono`, `os-browser`
Milestone: 9.0.0
rajshukla09 commented 6 months ago

The issue seems fixed when I downgraded the framework from 8 to 6

maraf commented 6 months ago

That's because in 6 we weren't producing source maps. I see it valid idea to remove the source map information when the source maps are disabled during build/publish

sleepwalkerffs commented 5 months ago

is there any workaround for this? Or how can i fix this for my blazor wasm?

maraf commented 5 months ago

is there any workaround for this? Or how can i fix this for my blazor wasm?

Does the download happen automatically or only when you open devtools?

sleepwalkerffs commented 5 months ago

On the affected iphones it happens automatically Edit: I also observed that Iphones that are the same (IPhone 11 in my case) are updated to IOS 17.4(latest i believe) the issue disappear and the .net runtime is downloaded normally.

maraf commented 5 months ago

On the affected iphones it happens automatically

How do you check that?

the issue disappear and the .net runtime is downloaded normally.

Are you saying that on the affected phone the blazor app doesn't start?

sleepwalkerffs commented 5 months ago

Yes exactly. I get stuck in the downloading of the runtime. This also happens on an older mac book pro When i open the console those are the erros that i see:

[Error] Did not parse stylesheet at 'https://bookennis.com/css/app-loading-progress.css' because non CSS MIME types are not allowed in strict mode.
[Error] Unhandled Promise Rejection: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    abort (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:979)
    w (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:1270)
    (anonyme Funktion) (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:200016)
    asyncFunctionResume
    (anonyme Funktion)
    promiseReactionJobWithoutPromise
[Error] MONO_WASM: instantiate_wasm_module() failed – Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    dt (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:12265)
    (anonyme Funktion) (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:201749)
    asyncFunctionResume
    (anonyme Funktion)
    promiseReactionJobWithoutPromise
[Error] MONO_WASM: w@https://bookennis.com/_framework/dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:1258
@https://bookennis.com/_framework/dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:200015
asyncFunctionResume@[native code]
@[native code]
promiseReactionJobWithoutPromise@[native code]
    u (dotnet.js:3:924)
    (anonyme Funktion) (dotnet.js:3:19935)
    ke (dotnet.js:3:20170)
    (anonyme Funktion) (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:201799)
    asyncFunctionResume
    (anonyme Funktion)
    promiseReactionJobWithoutPromise
[Error] Error in mono_download_assets: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    Ft (blazor.webassembly.js:1:46676)
    (anonyme Funktion) (dotnet.js:3:7914)
    promiseReactionJob
[Error] Unhandled Promise Rejection: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features (x4)
[Error] Unhandled Promise Rejection: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    quit_ (dotnet.native.8.0.3.jmv6bffab2.js:8:635)
    Me (dotnet.js:3:21071)
    ke (dotnet.js:3:20932)
    (anonyme Funktion) (dotnet.runtime.8.0.3.jnhe7kwgf9.js:3:201799)
    asyncFunctionResume
    (anonyme Funktion)
    promiseReactionJobWithoutPromise
[Error] Unhandled Promise Rejection: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
[Error] Unhandled Promise Rejection: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    quit_ (dotnet.native.8.0.3.jmv6bffab2.js:8:635)
    Me (dotnet.js:3:21071)
    ke (dotnet.js:3:20932)
    (anonyme Funktion) (dotnet.js:3:7954)
    promiseReactionJob
[Error] Unhandled Promise Rejection: Error: Failed to start platform. Reason: Error: Assert failed: This browser/engine doesn't support WASM SIMD. Please use a modern version. See also https://aka.ms/dotnet-wasm-features
    (anonyme Funktion) (blazor.webassembly.js:1:57418)
    asyncFunctionResume
    (anonyme Funktion)
    promiseReactionJobWithoutPromise
    promiseReactionJob
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (dotnet.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (dotnet.runtime.js.map, line 0)
maraf commented 5 months ago

That is not related to source maps. The error message says that the browser doesn't support SIMD. You can disable it by setting MSBuild properties WasmEnableSIMD and WasmEnableExceptionHandling to false. Also the link in the error message points to a documentation about various WASM features

reuben-ahmed commented 5 months ago

I have the same issue as the OP and I'm not willing to downgrade from .net 8. Are there any other solutions for iphone and mac/safari users to use our blazor apps?

maraf commented 5 months ago

@reuben-ahmed Are you mentioning the SIMD error or the one with source map?

For the SIMD there is a link in the error message describing what to do.

For the source map, it's not blocking and the error should happen only when the devtools are open

pavelsavara commented 2 months ago

@maraf I move this to Net10, please move it back if you disagree