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

NewRelic crash reports not working for .NET MAUI Blazor Hybrid App #56

Open
Qkyyy opened this issue Dec 19, 2024 · 2 comments
Open

NewRelic crash reports not working for .NET MAUI Blazor Hybrid App #56

Qkyyy opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Qkyyy
Copy link

Qkyyy commented Dec 19, 2024

Description

Hello.
We've been recently looking for a universal tool which we can use in most of our projects focused arount the .NET tech stack.
I've tried to hook up the NewRelic to .NET Maui Blazor Hybrid App, but it apperas to only track app launches. Logs and crashes unfortunately are not properly sent to the new relic UI. I've tried it using .NET8 and .NET9.
On basic .NET8 MAUI everything seems to work (crashes are reported properly)
Is there a way to conifgure NewRelic to work on .NET Maui Blazor Hybrid App? I've followed the configuration tutorial from your github page (https://github.com/newrelic/newrelic-maui-plugin)

Steps to Reproduce

  1. Create new .NET MAUI Blazor Hybrid App project
  2. Install NewRelic.Maui.Plugin nuget package
  3. Configure it following the instructions from the github page
  4. Throw test exception after some button click

Expected Behavior

On NewRelic site there should be visible errors on the dashboard (but there is only shown app launch, so NewRelic does send some information).

Relevant Logs / Console output

On basic .NET MAUI project, NewRelic succesfully sends the crash information

newrelic CrashSender: Crash 7279094a-f035-4e15-810c-7d29fb8c45d5 successfully submitted.

Your Environment

.NET 8, .NET 9
NewRelic.Maui.Plugin 1.1.6

Additional context

As I previously mentioned, it works properly on .NET MAUI app (sending crashes and logs) but on .NET MAUI Blazor Hybrid App it only tracks app launches.

@Qkyyy Qkyyy added the bug Something isn't working label Dec 19, 2024
@ndesai-newrelic
Copy link
Contributor

@Qkyyy Did you try the New Relic browser agent for the Blazor app, which is basically built using JavaScript and HTML? Our Maui agent is mostly for Android and iOS agents, which are built using C#.

@Qkyyy
Copy link
Author

Qkyyy commented Dec 20, 2024

@Qkyyy Did you try the New Relic browser agent for the Blazor app, which is basically built using JavaScript and HTML? Our Maui agent is mostly for Android and iOS agents, which are built using C#.

Hey, thanks for the quick reply!
Although while this is working, I have a couple of questions.
NewRelic doesnt seem to gather crash informations when you throw exceptions from within the .razor pages. throw new Exception("please catch me"); and await JSRuntime.InvokeVoidAsync("throwJsException") are not properly caught. When I call this script from the index.html like this:

<script>
        function throwJsException() {
            throw new Error("This is a JavaScript exception v222");
        }
        throwJsException();
</script>

It does get caught almost instantly - but as I said, only when I call the function from index.html which is a big problem for Blazor.
Also, while using the browser app for .NET MAUI Blazor Hybrid App, caught exceptions doesnt seem to have crucial information about the device as in the .MAUI Agent. Is there something we could do to make this work for our case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants