adopted-ember-addons / ember-cli-bugsnag Goto Github PK
View Code? Open in Web Editor NEWIntegrates Bugsnag reporting service into your Ember CLI app.
License: MIT License
Integrates Bugsnag reporting service into your Ember CLI app.
License: MIT License
In our Ember app, we have a currentUser
computed property on our session service, which returns a promise.
I'm hoping to use this currentUser()
method to populate the Bugsnag user
metadata via this promise-based method. However, returning a promise from utils/bugsnag.js getMetadata()
is not currently possible.
Do you forsee this being possible? Or will I have to develop a local workaround?
I need to require Bugsnag in a before hook to the ember build.
I have no problem requiring it when I install it using npm: npm install bugsnag --save-dev
However, I think since it's an ember-cli add-on, I'm having issues.
Docs say to require('bugsnag')
, but it doesn't seem available at this stage.
Do you have any thoughts on how I can require it in a file outside the app directory in the tasks directory, and before ember gets built ?
I'm reviewing some recent Bugsnags and realizing that the user
and metadata
tags are not always provided as part of the Bugsnag. I'm not 100% certain but I believe it's because there's some instances in our app where we recover from an error but still want to use Bugsnag.notifyException
.
The problem seems to be, from my understanding of that code, that getUser()
and getMetadata()
don't get called except from within onerror
: https://github.com/binhums/ember-cli-bugsnag/blob/master/app/instance-initializers/bugsnag.js#L50
The result of this seems to be that if the first Bugsnag report issued is a manual notifyException
, it won't contain pull in your user data / metadata. But if an onerror occurred, it'll set these values for all future notifyException
s.
I'm surprised no one's noticed this; it makes me wonder if I'm misusing the API somehow? Is it ok that I'm still using Bugsnag.notifyException
to report handled exceptions? Or is there a better workflow?
I published 2.0.1 today which had a fix for Ember 3.13+
I also made some changes to the version of node which required bumping ember-cli to 3.1.3+
In testing it on my work app I am seeing some regressions in our test suite that seem unrelated. Like floats being 1.250 instead of 1.25 all of a sudden.
Working on reproducing those errors, I am a little confused as it feels like if should be a simple dependency upgrade.
Route names instead of urls. Open questions: what happens if error is thrown mid transition?
This might not be an issue and maybe it's something I did wrong. We installed bugsnag a couple weeks ago and our app has been reporting errors regularly, both on production and our staging server. But none of them have been due to error caused by unfulfilled promises. And I'm pretty sure we have a few of those.
This is the stacktrace generated by an error in bugsnag right after Ember triggers and exception on RSVP when our api responds with a 500. It's really hard to debug due to the assets being minified.
Any clue on how to solve it?
Thanks for putting this add-on together, it was really easy to setup.
I was wondering if the config.bugsnag.libraryUrl
property is still relevant. From what I can tell the add-on was updated to pull the Bugsnag library from Bower and then, more recently, to use inline node assets to use the node module.
Thanks!
There's no tests. I'm working on it!
I'm trying to upgrade to Ember 2.5 from 2.0 and getting this: TypeError: instance.container is not a function
Sample initializer:
App.initializer({
name: 'appInitializers',
initialize: function(app) {
app.inject('controller', 'test', 'test:main');
app.inject('component', 'test', 'test:main');
app.inject('route', 'test', 'test:main');
app.inject('adapter', 'test', 'test:main');
app.inject('serializer', 'test', 'test:main');
},
});
wondering what I'm doing wrong. Thanks for any help.
Not sure what's going on here.
Since Ember-CLI 0.2.3, ember addons should not be installed using ember install ember-cli-bugsnag
- the readme should be upated.
When I ran the above install the package installed correctly. However, it threw an error after install:
version: 0.2.3 # Ember CLI version
Installed packages for tooling via npm.
installing
installing
The `ember generate` command requires an entity name to be specified. For more details, use `ember help`. # error
Chrome gives the following CSP error when using the addon:
[Report Only] Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src ... ". Either the 'unsafe-inline' keyword,
a hash ('sha256-Li1kX2hSsXxBIvK1YWeekOV49Asr5QAOvrIrILWqql0='), or a
nonce ('nonce-...') is required to enable inline execution.
It would be reasonably straightforward to generate a hash of the contents and inject that into the CSP rules in development, but I'm not sure how this would work in production. Obviously the addon doesn't integrate with the web-server in any way so there'd be no way of injecting this.
Adding a nonce to the config and using that in the script tag would also work, we'd just need to use the same nonce in the web-server config for it to work on live.
Another approach would be to not inject the script tag into the HTML at build time at all and instead dynamically inject the script at run-time using something like ember-inject-script.
This addon is using the Application Initializers API, which doesn't have access to app.lookup
anymore. It should probably be migrated to be an instance initializer to access app.lookup
as it fails in new ember versions.
It's fixed as easily as renaming app/initializers
to app/instance-initializers
I believe.
Bugsnag has put out a new major version. Currently 4.3.3
This is a complete rewrite that changes how bugsnag is used and thus just upgrading the package doesn't work.
I played around for an hour or so trying to get this to work but couldn't get it working again.
I can help if I get some direction but I don't have a lot of experience with Ember Addons and am running into a few walls.
Here is what I tried so far: https://github.com/Alonski/ember-cli-bugsnag/tree/upgradeBugsnag
This line will issue the following error if we don't set an api key:
Uncaught TypeError: Cannot read property '_config' of null
at Object.initialize (bugsnag.js:15)
What do you think of improving the guard like this ?
if (!Bugsnag._client || Bugsnag._client._config.apiKey === undefined) {
return;
}
Since emberjs/ember.js#13022 has been merged, it would be very nice to get rid of the bower dependency and start using the npm version of the bugsnag.
https://github.com/bugsnag/bugsnag-js
https://www.npmjs.com/package/bugsnag-js
1.0.0+
always thinks I am in production so is always logging when in development. I made sure it was properly in development still checking right before an error occurred.
I went through code and couldn't find out why, mine and yours. But it works fine on 0.2.0
so just sticking with that as I haven't got time to find the actual issue or diff what changed between versions.
For some reason Ember 1.13.x doesn't have treeForApp
available on this._super
on line 23:36
ember-cli-bugsnag/index.js:
...
treeForApp: function() {
if (this._includeBugsnag) {
return this._super.treeForApp.apply(this, arguments); // Cannot read property 'apply' of undefined
}
},
...
Seems the ember-data team discovered this also: https://github.com/emberjs/data/blob/master/index.js#L95
Currently installed ember-cli-bugsnag v1.0.2.
Is there any way to fix this?
Ember-CLI only supports development, test, and production, so we end up using config.environment = "production"
for production and staging.
I'd love to be able to override that with
// config/environment.js:
bugsnag: {
releaseStage: process.env.MY_APP_ENVIRONMENT
}
and have this addon default to config.environment
if that isn't specified:
// index.js:
var releaseStage = bugsnagConfig.releaseStage || config.environment;
...
'Bugsnag.releaseStage = "' + releaseStage + '";',
This LOC has the potential of causing an 'Uncaught ReferenceError' when config.bugsnag
is undefined.
The latest version published to npm is 0.1.5
.
It seems that a TransitionAborted error doesn't have a stack trace.
This is causing us problems for now but having looked through the Ember code base this appears to be something that might not be an error situation. I think we abort some transitions manually in our apps.
Any plans on getting fastboot support out of the box for this addon?
The ideal would be that this addon uses the node version of bugsnag when running in fastboot, and then when running in the browser it uses the JS version.
First step, at least, is to get this to not include the browser version of JS in fastboot land.
I'm trying to include this addon inside another addon and it then does not include the bugsnag.js shim
I'm assuming this is an upstream issue, and I've reported it as bugsnag/bugsnag-js#171.
Nonetheless, I wanted to note it here.
I'm hitting an annoyance, when adding user metadata to my exception - my user ID is being ignored, and the default IP address is always being used instead.
I'm using the Bugsnag.notify
API and therfore have to
import Bugsnag from 'bugsnag';
However, this breaks my tests:
Chrome 43.0 - Global error: Uncaught Error: Could not find module
bugsnag
imported from
Any suggestions here? I'm curious why index.js
explicitly does not include bugsnag in test
environments.
// index.js
this._includeBugsnag =
this.isDevelopingAddon() || process.env.EMBER_ENV !== 'test';
Any chance we could import just the bugsnag/shim
in test
environments?
Related to bugsnag/bugsnag-js#192
The current ember-cli-fastboot
releases (1.0.0-rc.1 and above) introduce breaking changes. These will most likely break your current FastBoot implementation.
See ember-fastboot/ember-cli-fastboot#387 for more information and a guide on how to fix your addon. Also you may want to visit the -fastboot
Slack channel to get help from other users.
Note: this issue has been created automatically, by searching for certain patterns in your code. If you think this has been falsely created, feel free to close!
Hi! ๐
It seems ember-cli-bugsnag
triggers the deprecate-router-events deprecation.
I haven't noticed this before nor I'm I sure as to why it suddenly pops up now (for me).
If I exclude the addon from the build, the warning is gone.
I'm guessing L32 is the culprit?
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.