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

Raygun Typescript error #259

Closed
granteagon opened this issue Nov 16, 2017 · 2 comments
Closed

Raygun Typescript error #259

granteagon opened this issue Nov 16, 2017 · 2 comments

Comments

@granteagon
Copy link
Contributor

My setup:

index.html:

<script type="text/javascript">
        !function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){
        (a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0],
        f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){
        h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({
        e:g})}}(window,document,"script","//cdn.raygun.io/raygun4js/raygun.min.js","rg4js");
    </script>

AngularJS Typescript Service:

declare const rg4js: RaygunV2;
declare const raygunApiKey: string;
// var rg4js  = require('raygun4js');
raygunService.$inject = ['pingService'];

export function raygunService (pingService) {

    const service = {
        configure: configure
    };

    return service;

    function configure (user) {
        if (user) {
            rg4js('setUser', {
                identifier: user.email,
                isAnonymous: false,
                email: user.email,
                fullName: user.fullName
            });
        }
        rg4js('apiKey', raygunApiKey);
        rg4js('enableCrashReporting', true);
        rg4js('enablePulse', false);
    }
}
  1. Nothing gets logged to Raygun
  2. No errors from raygun in the console
  3. Created a test error for logging example
  4. Verified the code is running
  5. Verified api key is correct
  6. No XHR to raygun happens.
  7. Thanks!
@sumitramanga
Copy link
Contributor

Hi there, as you are using Angular, have you managed to follow these instructions instead to better suit your project? - https://raygun.com/documentation/language-guides/javascript/crash-reporting/angular/

@granteagon
Copy link
Contributor Author

Uh... I don't know. I guess I figured it out. I certainly haven't been struggling with the same issue since 2017...

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

No branches or pull requests

2 participants