Raygun Crash Report configuration for Vanilla JS

RJ

Posted on
Oct 04 2019

I created a simple ASP.NET Core MVC project then imported the development script file of raygun.js inside the _Layout.cshtml file.

<script type="text/javascript" src="~/lib/raygun/raygun.js"></script>
<script type="text/javascript">
        Raygun.init('MY-API-KEY').attach();
</script>

After that, I run my project and performed some exceptions.

eval("alerrrt('hello')")
eval("x*123")

But, I didn't receive any reports on my accounts. Can anyone help me regarding my problem? Thank you.


John-Daniel Trask

Raygun

Posted on
Oct 07 2019

Hi RJ,

Can you confirm how you're generating those exceptions? Did you deploy code for them? Reason I ask is that if you use the Chrome Dev Tools, exceptions from the console do not trigger the window.onerror event to fire, which Raygun relies on for unhandled exceptions.

(I'm also assuming 'MY-API-KEY' is something you substituted in, and you do have an API key set? :-) )

I hope that helps,

John-Daniel Trask


Reply