-
-
Notifications
You must be signed in to change notification settings - Fork 226
fix: disallow building Blazor WASM with Profiling #4512
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
fix: disallow building Blazor WASM with Profiling #4512
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4512 +/- ##
=======================================
Coverage 73.43% 73.43%
=======================================
Files 479 479
Lines 17506 17506
Branches 3480 3480
=======================================
Hits 12856 12856
Misses 3772 3772
Partials 878 878 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks @alexsohn1126 !
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- disallow building Blazor WASM with Profiling ([#4512](https://github.com/getsentry/sentry-dotnet/pull/4512))If none of the above apply, you can opt out of this check by adding |
Fixes #3523:
Problem
We do not support profiling in Blazor WebAssembly apps. However, it was possible to pass initialize a Blazor WASM app with profiling, which led to undefined behaviours.
The issue above reported failing to publish Blazor WASM app when profiling is enabled. I was not able to replicate that, both in the current version of SDK, and also the version that the issue reporter was using (v4.9.0).
I did find that adding profiling in Blazor WASM led to errors in the browser:
Fix
Notify the user if they are using
Sentry.Profilingin a Blazor WebAssembly project. If so, we throw an error pre-build, with a more descriptive message:This was possible because Blazor WebAssembly apps have
UsingMicrosoftNETSdkBlazorWebAssemblyMSBuild property. See:Testing Instructions
Sentry.Profilingpackage in a Blazor WebAssembly.csproj:<PackageReference Include="Sentry.Profiling" Version="5.15.1"/>csprojfile (before</Project>), importSentry.Profiling.targets. In the case ofsamples/Sentry.Samples.AspNetCore.Blazor.Wasm.csproj:<Import Project="..\..\src\Sentry.Profiling\buildTransitive\Sentry.Profiling.targets" />See also: