runtime icon indicating copy to clipboard operation
runtime copied to clipboard

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

Open rajshukla09 opened this issue 2 years ago • 19 comments

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

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?

rajshukla09 avatar Feb 11 '24 06:02 rajshukla09

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

.NET Version

8

Anything else?

You can see the deployed code https://github.com/rajshukla09/sfurtlive

Author: rajshukla09
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

ghost avatar Feb 12 '24 10:02 ghost

@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.

javiercn avatar Feb 12 '24 10:02 javiercn

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

maraf avatar Feb 17 '24 06:02 maraf

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

.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

ghost avatar Feb 17 '24 06:02 ghost

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

rajshukla09 avatar Feb 17 '24 10:02 rajshukla09

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

maraf avatar Feb 17 '24 14:02 maraf

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

sleepwalkerffs avatar Mar 21 '24 07:03 sleepwalkerffs

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?

maraf avatar Mar 21 '24 08:03 maraf

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.

sleepwalkerffs avatar Mar 21 '24 09:03 sleepwalkerffs

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?

maraf avatar Mar 21 '24 09:03 maraf

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)

sleepwalkerffs avatar Mar 21 '24 09:03 sleepwalkerffs

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

maraf avatar Mar 21 '24 11:03 maraf

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?

reuben-ahmed avatar Mar 22 '24 14:03 reuben-ahmed

@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

maraf avatar Mar 22 '24 16:03 maraf

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

pavelsavara avatar Jul 04 '24 16:07 pavelsavara

We are also facing this issue and it's very annoying, because it's filling our logs on server for no reason. We are using .NET8

ghost avatar Oct 22 '24 08:10 ghost

iPadOS 18.4.1 - Blazor Wasm 9.0.4 or 9.0.3 - stopped to work

I get the errors

[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)

And the app does not load at all

tnx

gptucci avatar Apr 22 '25 17:04 gptucci

@maraf what is the status of this?

lewing avatar Aug 05 '25 22:08 lewing

Source maps are requested by browsers (both Chromium-based and Safari) only when DevTools are opened. Until the console is opened, no requests are issued and thus no errors occur.

maraf avatar Aug 12 '25 12:08 maraf