Registry / observability / ember-cli-sentry

ember-cli-sentry

JSON →
library4.1.0jsnpmunverified

An ember-cli addon that integrates Sentry (Raven.js) error tracking into Ember.js applications. The current stable version is 4.1.0, released in 2019, with maintenance releases since then. It supports Node 6+ and Ember CLI 2.13+. Key differentiators: provides an Ember service for reporting errors, automatic global error catching for Ember.onerror and RSVP, and configuration via environment variables. Compared to manual Raven.js integration, it offers idiomatic Ember conventions and easier setup.

npm install ember-cli-sentry
INSTALL
IMPORT
SIG · EMBER-CLI-SENTRY
E
ember-cli-sentry
observabilityjavascriptv4.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import sentry from 'ember-cli-sentry';
const sentry = require('ember-cli-sentry');
The addon is consumed via the Ember service 'raven', not via import. The import path above is for internal usage only.
service
import { inject as service } from '@ember/service'; const sentry = service('raven');
import sentry from 'ember-cli-sentry/services/raven';
Inject the 'raven' service to use logging/captureError. Do not import directly from the addon.
config
// config/environment.js module.exports = function(environment) { return { sentry: { dsn: '...' } }; };
// Attempting to import Raven from node_modules
Configuration is done via environment.js, not by importing Raven. The addon initializes Raven based on this config.

Shows installation, configuration with DSN and options, and usage of the raven service to capture exceptions.

ember install ember-cli-sentry // config/environment.js module.exports = function(environment) { var ENV = { sentry: { dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0', development: (environment === 'development'), debug: true, globalErrorCatching: true } }; return ENV; }; // In any component or route import { inject as service } from '@ember/service'; export default class MyComponent extends Component { @service raven; handleError() { this.raven.captureException(new Error('Something went wrong')); } }
Debug
Known issues
breakingv4.0.0 requires Node >=6 and Ember CLI >=2.13; ember-cli-babel updated to v7, which may break apps using older babel configs.
fix
Upgrade Node and Ember CLI to supported versions; ensure project uses ember-cli-babel v7 compatible config.
affects: <4.0.0
breakingv3.0.0 removed implicit 'raven' service injection; you must manually inject the service in components/routes.
fix
Add @service raven in your Ember classes where you need Sentry logging.
affects: <3.0.0
breakingv3.0.0 removed config property 'ignoreErrors'; use Raven option 'ignoreErrors' via 'ravenOptions.ignoreErrors' instead.
fix
Move ignoreErrors to ravenOptions in sentry config.
affects: <3.0.0
breakingv3.0.0 removed 'serviceName' property; service is fixedly named 'raven'.
fix
Replace any custom serviceName references with 'raven' when injecting.
affects: <3.0.0
deprecatedThe addon is no longer actively maintained; consider migrating to '@sentry/ember' for official Sentry support.
fix
Replace ember-cli-sentry with @sentry/ember: ember install @sentry/ember; adjust config.
affects: >=0.0.0
gotchaContent Security Policy (CSP) must allow connections to app.getsentry.com; otherwise raven requests will be blocked.
fix
Add 'connect-src app.getsentry.com' to CSP rules.
affects: >=0.0.0
gotchaSetting `development: true` disables sending to Sentry but still logs to console; this may cause confusion in development mode.
fix
Ensure sentry config property 'development' is correctly set per environment.
affects: >=0.0.0
Errors
Common errors & fixes
ENOENT: no such file or directory, open 'node_modules/ember-cli-sentry/addon/services/raven.js'
The addon's service file is missing or not properly linked; often due to incomplete install or version mismatch.
fix
Reinstall the addon: `rm -rf node_modules && npm install` or upgrade ember-cli.
Uncaught TypeError: Cannot read property 'captureException' of undefined
The raven service was not injected in the component/route.
fix
Ensure `@service raven` is present in the class.
sentry.dsn is not a string
The 'dsn' property in config is missing or not a valid string.
fix
Set a valid sentry DSN in config/environment.js: `sentry: { dsn: 'https://key@o0.ingest.sentry.io/0' }`.
Raven is not defined
Trying to access Raven global before initialization; or addon not properly loaded.
fix
Use the raven service instead of Raven global.
Upgrade
Version history
4.1.0latest on npm
Audit
Dependencies
ember-cli-babelrequiredTranspiles ES2015+ code to support older browsers and Node versions
ember-cli-htmlbarsoptionalCompiles Handlebars templates used in the addon
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
2
Resources
ember-cli-sentry — npm install ember-cli-sentry · libregistry