Skip to content

Conversation

@jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Oct 14, 2025

Addresses this error when trying to build WASM client applications on Windows:

PS C:\code\MyTestProject\MyTestProject.Client> dotnet build -p:WasmBuildNative=true
Restore complete (0.4s)
    info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MyTestProject.Client failed with 2 error(s) (11.3s)
    emcc : error /NODEFAULTLIB:MSVCRT: No such file or directory ("/NODEFAULTLIB:MSVCRT" was expected to be an input file, based on the commandline arguments provided)
    C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.0-rc.1.25451.107\Sdk\BrowserWasmApp.targets(522,5): error MSB3073: The command "emcc "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0-rc.1.25451.107\runtimes\browser-wasm\native\src\emcc-default.rsp" -msimd128 "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0-rc.1.25451.107\runtimes\browser-wasm\native\src\emcc-link.rsp" "@C:\code\MyTestProject\MyTestProject.Client\obj\Debug\net10.0\wasm\for-build\emcc-link.rsp"" exited with code 1.

May also resolve #4550

Although initial feedback from the customer is that it does not. Hard to verify as I haven't been able to reproduce that issue yet.

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (version6@6377b49). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             version6    #4631   +/-   ##
===========================================
  Coverage            ?   73.08%           
===========================================
  Files               ?      479           
  Lines               ?    17381           
  Branches            ?     3430           
===========================================
  Hits                ?    12703           
  Misses              ?     3819           
  Partials            ?      859           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

<!-- net8.0 or greater -->
<FrameworkSupportsNative Condition="'$(_SentryIsNet8OrGreater)' != 'true' or !('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe')">false</FrameworkSupportsNative>
<!-- WASM -->
<FrameworkSupportsNative Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">false</FrameworkSupportsNative>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: WASM Disable Condition Overrides User Setting

The WASM disabling condition for FrameworkSupportsNative is evaluated before the explicit user opt-in/opt-out. This allows users to override the WASM disable by setting SentryNative=true, potentially reintroducing build errors for WASM applications.

Fix in Cursor Fix in Web

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was intentional yes...

### Fixes

- The SDK avoids redundant scope sync after transaction finish ([#4623](https://github.com/getsentry/sentry-dotnet/pull/4623))
- sentry-native is now automatically disabled for WASM applications ([#4631](https://github.com/getsentry/sentry-dotnet/pull/4631))
Copy link
Member

@Flash0ver Flash0ver Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is this clearer?

Suggested change
- sentry-native is now automatically disabled for WASM applications ([#4631](https://github.com/getsentry/sentry-dotnet/pull/4631))
- sentry-native is now disabled per default for WASM applications ([#4631](https://github.com/getsentry/sentry-dotnet/pull/4631))

Which phrasing is conveying more clearly, that we disable it per default, but it could still be manually enabled?

On the other hand, it doesn't really make sense to manually enable sentry-native for Blazor-WASM.
I actually do prefer now as-is ... but wanted to keep the comment anyway.

@jamescrosswell jamescrosswell merged commit 7645341 into version6 Oct 16, 2025
32 checks passed
@jamescrosswell jamescrosswell deleted the no-native-on-wasm branch October 16, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants