Giter Site home page Giter Site logo

kredde / ember-error-tracker Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 6.25 MB

Custom error and event tracking for Ember.js apps

License: MIT License

JavaScript 90.16% HTML 9.78% Handlebars 0.06%
ember ember-addon ember-cli-addon error error-logging exception logging

ember-error-tracker's Introduction

Hi there ๐Ÿ‘‹๐Ÿพ my name is Kristian!

https://twitter.com/kr3dde https://linkedin.com/in/kristian-schwienbacher

image

ember-error-tracker's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ember-tomster avatar gspain avatar gspain-gavant avatar kredde avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

gspain aalimovs

ember-error-tracker's Issues

Add additional client info to API endpoint request

Hi, thanks for your work on this addon!

I was wondering if you'd be able to add some additional values to the API endpoint consumer's ajax request, specifically:

  • currentUrl
  • resolution (e.g. window.screen.width/height)
  • viewPort (e.g. window.innerWidth/innerHeight)

Also, I have not tested this yet, but is this addon compatible with FastBoot? Or has guards to prevent running non-node.js compatible code (e.g. accessing window, etc) while in FastBoot?

Thanks!

Octane compatibility

Hello,

I am trying to install this addon with a new Ember Octane app and I am getting a console error. Am I missing something or is this addon not compatible? Thanks

Uncaught (in promise) Error: Assertion Failed: An EmberObject based class, (unknown), was not instantiated correctly. You may have either used `new` instead of `.create()`, or not passed arguments to your call to super in the constructor: `super(...arguments)`. If you are trying to use `new`, consider using native classes without extending from EmberObject.
    at assert (index.js:172)
    at new CoreObject (core_object.js:239)
    at new EmberObject (object.js:24)
    at new ErrorLogger (error-logger.js:32)
    at Object.initialize (error-tracker.js:12)
    at index.js:156
    at Vertices.each (dag-map.js:231)
    at Vertices.walk (dag-map.js:145)
    at DAG.each (dag-map.js:75)
    at DAG.topsort (dag-map.js:83)

FastBoot compatibility fixes

Thanks again for adding those new properties @kredde they look great!

I did, however, notice some small issues while running the addon in FastBoot still. Specifically, if an error is thrown when the app runs in fastboot, I'm getting:

(node:81599) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'width' of undefined

and

(node:81599) UnhandledPromiseRejectionWarning: ReferenceError: navigator is not defined

It looks like window itself still exists in FastBoot, so the guards have to be a bit more specific I think. I was able to resolve these with some local modifications to the addon's consumers/consumer.js file:

consumeError(error) {
    //...

    if (window && window.screen) {
        //...
    }

    if (window && window.location) {
        //...
    }

    const payload = {
        error,
        userAgent: window && window.navigator ? window.navigator.userAgent : undefined,
        screen,
        location,
        events: this.eventStack.array
    };

    //...
}

This appears to be the recommended pattern for these issues:
https://ember-fastboot.com/docs/addon-author-guide#how-to-fix-it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.