{"id":16995,"library":"ember-cli-notifications","title":"Ember CLI Notifications","description":"Ember CLI Notifications is an Ember addon that provides Atom-inspired, transient notification messages for Ember applications. It enables developers to display various types of in-app alerts such as success, error, warning, and info messages, typically appearing at the top of the screen. The current stable version is 9.1.0, released in January 2025. This package generally follows a release cadence tied to Ember.js and Ember CLI updates, with major versions often introducing breaking changes to keep pace with the evolving Ember ecosystem, typically every 1-2 years. Key differentiators include its focus on a simple, injectable service for managing notifications, allowing programmatic control over message display, and offering customizable styling options. It integrates seamlessly into modern Ember applications, supporting Embroider and ember-auto-import v2.","status":"active","version":"9.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/mansona/ember-cli-notifications","tags":["javascript","alerts","ember","ember-addon","ember-cli","notifications"],"install":[{"cmd":"npm install ember-cli-notifications","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-notifications","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-notifications","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Ember.js application compatibility.","package":"ember-source","optional":false},{"reason":"Required for modern asset importing in Ember apps, or Embroider compatibility.","package":"ember-auto-import","optional":true},{"reason":"Alternative to ember-auto-import v2 for modern Ember build systems.","package":"embroider","optional":true}],"imports":[{"note":"Used to inject the notifications service into Ember components, controllers, or routes. Requires the `inject as service` alias.","wrong":"import service from '@ember/service';","symbol":"service","correct":"import { inject as service } from '@ember/service';"},{"note":"The name of the injected service. Changed to `notifications` in v5.0.0 from an earlier, potentially singular, name.","wrong":"@service notification;","symbol":"notifications","correct":"@service notifications;"},{"note":"While direct import of the service class is possible for advanced scenarios or testing, it's generally discouraged in favor of service injection via `@service`.","symbol":"NotificationsService","correct":"import NotificationsService from 'ember-cli-notifications/services/notifications';"}],"quickstart":{"code":"import Controller from '@ember/controller';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class ApplicationController extends Controller {\n  @service notifications;\n\n  @action\n  showSuccessNotification() {\n    this.notifications.success('Operation successful!', {\n      autoClear: true,\n      clearDuration: 3000,\n      cssClasses: 'custom-success-class',\n      htmlContent: '<b>Successfully</b> completed action.'\n    });\n  }\n\n  @action\n  showErrorNotification() {\n    this.notifications.error('Something went wrong.', {\n      autoClear: false,\n      cssClasses: 'custom-error-class'\n    });\n  }\n\n  @action\n  showPersistentInfo() {\n    this.notifications.info('This is an informational message.', {\n      autoClear: false,\n      clearDuration: 0 // Will stay until manually cleared\n    });\n  }\n\n  @action\n  clearAllNotifications() {\n    this.notifications.clearAll();\n  }\n}","lang":"typescript","description":"Demonstrates how to inject the `notifications` service into an Ember controller and use it to display various types of notifications (success, error, info) with custom options, as well as clearing them."},"warnings":[{"fix":"Ensure your Ember application is running Ember.js 3.16 or higher and is compatible with Ember v2 addons. You may need to update your `ember-cli-build.js` or `package.json` configurations.","message":"Version 9.0.0 transitioned to an Ember v2 addon format and dropped support for Ember.js versions older than 3.16.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Migrate your icon customization to use component-based overrides. Remove any usage of the `equals` helper and upgrade your Node.js environment to a supported version (Node.js 12+).","message":"Version 8.0.0 replaced overridable icon *paths* with overridable icon *components*, removed the obsolete `equals` helper, and dropped support for Node.js 10.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Upgrade your Node.js environment and Ember.js application to supported versions (Node.js 10+, Ember.js 3.8+).","message":"Version 7.0.0 dropped support for Node.js 8, Ember.js 2.18, and Ember.js 3.4.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Remove `ember-cli-notifications` related Font Awesome configuration. Update all service injections to use `@service notifications;`. Refactor any CSS overrides that relied on CSS Modules to use standard CSS practices.","message":"Version 5.0.0 introduced significant changes including the removal of Font Awesome as a default dependency, renaming the notifications service to simply `notifications`, and removing CSS Modules.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"When creating a notification, pass `autoClear: false` in the options object to make it persistent, or set `clearDuration: 0` to prevent automatic clearing regardless of `autoClear`.","message":"Notifications are transient by default. If `autoClear` is true, they will disappear after `clearDuration`. Set `autoClear: false` or `clearDuration: 0` for persistent notifications.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure `import { inject as service } from '@ember/service';` is present and `@service notifications;` is used on the class property where you intend to use the service.","cause":"The `notifications` service has not been correctly injected or is not available in the current context.","error":"TypeError: Cannot read properties of undefined (reading 'success') (or similar for other notification types)"},{"fix":"Run `ember install ember-cli-notifications` again. If that doesn't work, try clearing your `node_modules` and `tmp` directories (`rm -rf node_modules tmp && npm install`) and then rebuilding.","cause":"This usually indicates an issue with `ember-cli-notifications` not being correctly linked or built, or a cached `node_modules` issue.","error":"Error: Could not find module `ember-cli-notifications/config/environment`"},{"fix":"Refactor your templates to use standard Ember template helpers for comparison (e.g., `{{if (eq this.value 'some-string')}}`) or update your dependencies.","cause":"The `equals` helper was removed in v8.0.0. Your application or a dependency is still using it.","error":"DEPRECATION: Using the {{equals}} helper is deprecated."}],"ecosystem":"npm","meta_description":null}