kredde / ember-error-tracker Goto Github PK
View Code? Open in Web Editor NEWCustom error and event tracking for Ember.js apps
License: MIT License
Custom error and event tracking for Ember.js apps
License: MIT License
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!
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.