Giter VIP home page Giter VIP logo

ember-cli-rollbar's Introduction

ember-cli-rollbar ** This Addon Is Unmaintained Has Been Deprecated **

Please use the very fine ember-rollbar-client instead.

Thanks for all the help and support!

ember-cli-rollbar's People

Contributors

alsemyonov avatar andremalan avatar davewasmer avatar donaldwasserman avatar ember-tomster avatar mansona avatar mike-north avatar paulcwatts avatar shunchu avatar svvitale avatar wcurtis avatar wireframe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-rollbar's Issues

Could not find module `rollbar` for disabled environments

I have just implemented this addon, and wanted to enable it only for production environment.
I've set this in my config/environment.js like your readme says.

In my application I'm importing rollbar to set the person and throw custom logs.

Everything is working fine if I run my application in the environment where rollbar is enabled (so in this case production). But if I want to run my application in the staging or development environment, I'm getting the follow error:

Uncaught Error: Could not find module `rollbar` imported from ...

Apparently I can't import the rollbar instance, so my app is bugging when rollbar is disabled. How did you guys handle this?

Content Security Policy

I serve my app with a CSP. I'd previously been using Airbrake, and thought I'd try rollbar. The main stumbling block was setting up the CSP for inline script in ember-cli-rollbar. I didn't just want to add 'unsafe-inline' so here's what to do

  1. Install and configure ember-cli-rollbar (changing configuration will change the script hash)
  2. Run ember locally in production environment ember server -e production
  3. Have a look in chrome console for the error similar to
Either the 'unsafe-inline' keyword, a hash ('sha256-Fm2/whhYQWeKGsFHC3/85HdIC/aNhx6cI/mOZSebPSo='), or a nonce ('nonce-...') is required to enable inline execution.
  1. Copy and paste the 'sha256-....' portion to the relevant server configuration file.

I add it to my config/environment.js file and generate my CSP headers using https://gist.github.com/mrloop/41ee14daecaf1873cee0

Now I need to remember to update the hash if the rollbar snippet is updated or my configuration changes.
I'm wondering if there's a better way of loading rollbar which isn't inline.

Support static imports

Right now, we expose the Rollbar lib as a module so it's theoretically importable. But we only app.import() the Rollbar lib if the config.enabled value is true, and it defaults to false in development. Which means, if you import Rollbar, it will error out in dev.

This line needs to change to import Rolbar regardless of whether or not it was enabled.

Support Fastboot environment

It would be great if we could support Rollbar in a Fastboot environment. I'm thinking we could import a shim that wraps Node's process.onUncaughtException in a window.onerror interface, so Rollbar could be imported (since it relies on that interface) and could report errors from Fastboot.

Open questions:

  • Is this the right approach in Fastboot? Does it make sense to mock out window.onerror?
  • Are there any concerns with the multiple application instance environment in Fastboot? Are there multiple logger instances? Do Rollbar reports need to distinguish between them?
  • What additional metadata (if any) should be included to indicate the error comes from Fastboot?

Upgrade to latest rollbar.js version?

Hello,

When using this we're getting a warning on the rollbar web that says:

rollbar.js version 1.3.0 is now available. (This project is currently using version 1.2.2).

I'm not sure if it would be possible to upgrade to this version, or is ember-cli-rollbar completely independent from the official rollbar.js?

cannot be used within addons: Cannot read property 'env' of undefined

Cannot read property 'env' of undefined
TypeError: Cannot read property 'env' of undefined
    at Class.included (/home/circleci/code/node_modules/ember-cli-rollbar/index.js:13:46)
    at addons.map.addon (/home/circleci/code/node_modules/ember-cli/lib/models/addon.js:383:34)
    at Array.map (<anonymous>)
    at Class.eachAddonInvoke (/home/circleci/code/node_modules/ember-cli/lib/models/addon.js:381:24)
    at Class.included (/home/circleci/code/node_modules/ember-cli/lib/models/addon.js:652:10)
    at Class.superWrapper [as included] (/home/circleci/code/node_modules/core-object/lib/assign-properties.js:34:20)
    at EmberAddon.<anonymous> (/home/circleci/code/node_modules/ember-cli/lib/broccoli/ember-app.js:527:17)
    at Array.filter (<anonymous>)
    at EmberAddon._notifyAddonIncluded (/home/circleci/code/node_modules/ember-cli/lib/broccoli/ember-app.js:524:47)
    at EmberAddon.EmberApp (/home/circleci/code/node_modules/ember-cli/lib/broccoli/ember-app.js:144:10)

seems like you should be using app instead of this.app

https://github.com/davewasmer/ember-cli-rollbar/blob/master/index.js#L13
https://github.com/damiencaselli/ember-cli-sentry/blob/master/index.js#L17
ember-cli/ember-cli#3718

Add source maps

Source maps will help identify which file and line of pre-minified code the error lives on.

Without source maps, errors look like this (line 1 of some minified file)
screen shot 2015-09-23 at 1 47 56 pm

Haven't looked into the details of implementing yet, but here are the docs from rollbar if someone has time to get started on it: https://rollbar.com/docs/source-maps/

Release 0.2.6 on NPM

Hi, thanks for the great addon. Is it possible to release the latest version on NPM?

Not catching errors for Android and Ios builds

Hi,
We have implemented ember-cli-rollbar with our ember app and its working fine but its not catching errors for Android build we are using ember-cli-cordova for android build.

In our /services/logger.js

import Ember from "ember";
import config from "../config/environment";
import rollbar from 'rollbar';

export default Ember.Service.extend({
  session: Ember.inject.service(),

  notifyError: function(reason) {
    var userName = this.get("session.currentUser.fullName");
    var userId = this.get("session.currentUser.id");
    var error = reason instanceof Error || typeof reason !== "object" ?
        reason : JSON.stringify(reason);
    var environment = config.staging ? "staging" : config.environment;
    var version = `${config.APP.SHA}`;

    this.notifyRollBar(error, { id: userId, username: userName, environment: environment});
  },

  notifyRollBar(err, log_details) {
    rollbar.error(err, log_details);
  }
});

When we get error on browser rollbar.error(err, log_details); send request to rollbar but when we get an error on android build Its not making request to rollbar and rollbar.notifier is null .

Upgrade to rollbar.js v1.5

Rollbar.js v1.5 just dropped today.

From the changelog:

v1.5.0

  • Published rollbar.js to npmjs.com as rollbar-browser. (pr#127)
  • Fixes a bug where thrown non-error objects were not properly handled. (pr#125)
  • Fixes a bug that was logging an incorrect message when the notifier was disabled. (pr#124)
  • Changes were made to the reported message for jQuery AJAX errors. This will cause some existing errors to have a different fingerprint and show up as new errors.
  • Lots of code cleanup and smaller minified file size.

Upgrade to Rollbar.js 1.6.1

v1.6.1

  • Updated bower.json to contain only a single .js entry. (issue#126)

v1.6.0

  • Fixed a bug that caused IE 8 to not properly initialize window.Rollbar. (pr#129)
  • Fixed the XDomainRequest code to work properly in IE 8.
  • Updated error parsing to provide more useful information for IE 8 errors

window.Rollbar.init is not a function

Hi,
We are using ember-cli-rollbar 0.3.1 and we countered below issue:
zrzut ekranu 2018-04-24 o 08 40 43
zrzut ekranu 2018-04-24 o 08 38 40

Problem occurs always on refresh page or initial page open.
Does anyone have any idea what can cause the problem ?

Log Levels

Is there a way to set the log level to just Error.

I have a bunch of Deprecations (waiting for libraries) and would like
to exclude these to rollbar.

rollbar: {
  accessToken: 'MY_CODE',
  enabled: environment !== 'development',
  captureUncaught: true,
  logLevel: 'error',
  payload: {
    environment: environment
  }

I was hoping we could add logLevel but its not used.

"document is not defined" in FastBoot environment

Every time I try to enable rollbar in environment.js:

rollbar: {
    enabled: true
}

I have an error in fastboot:

App is being served by FastBoot
/home/user/projects/outingtravel/web/tmp/funnel-output_path-PiiPro2c.tmp/assets/vendor.js:339
!function(r){function e(t){if(o[t])return o[t].exports;var n=o[t]={exports:{},id:t,loaded:!1};return r[t].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o
={};return e.m=r,e.c=o,e.p="",e(0)}([function(r,e,o){"use strict";var t=o(1).Rollbar,n=o(2);_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://d37gv
rvc0wt4s1.cloudfront.net/js/v1.9/rollbar.min.js";var a=t.init(window,_rollbarConfig),i=n(a,_rollbarConfig);a.loadFull(window,document,!_rollbarConfig.async,_rollba
rConfig,i)},function(r,e){"use strict";function o(r){return function(){try{return r.apply(this,arguments)}catch(e){try{console.error("[Rollbar]: Internal error",e)
}catch(o){}}}}function t(r,e,o){window._rollbarWrappedError&&(o[4]||(o[4]=window._rollbarWrappedError),o[5]||(o[5]=window._rollbarWrappedError._rollbarContext),win
dow._rollbarWrappedError=null),r.uncaughtError.apply(r,o),e&&e.apply(window,o)}function n(r){var e=function(){var

ReferenceError: document is not defined
    at Object.<anonymous> (/home/user/projects/outingtravel/web/tmp/funnel-output_path-PiiPro2c.tmp/assets/vendor.js:339:452)
    at e (/home/user/projects/outingtravel/web/tmp/funnel-output_path-PiiPro2c.tmp/assets/vendor.js:339:107)

...

Is it possible to disable rollbar loading in fastboot environment?

Question on Ember version support

I have an admittedly older version of Ember (v1.13.15; yes, I know. There's plan to do the upgrade soon). Using the package gives me the following error:

this._super.treeForVendor is not a function

Is there a threshold on how new your Ember app must be to be compatible with this package?

Fix breaking changes in FastBoot 1.0

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!

Error level

Is there any way how to set level to be reported?
Warnings are logged too, and this make noise in Rollbar reports.

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.