emberjs/ember.js · warning · Error

${formatMessage(message)}

Error message

${formatMessage(message)}

What it means

Ember's deprecate() system allows raising instead of warning: when ENV.RAISE_ON_DEPRECATION is true, the default handler throws an Error whose message is the formatted deprecation message, turning deprecation warnings into hard failures.

Source

Thrown at packages/@ember/debug/lib/deprecate.ts:166

          }

          stackStr = `\n    ${stack.slice(2).join('\n    ')}`;
        }
      }

      let updatedMessage = formatMessage(message, options);

      console.warn(`DEPRECATION: ${updatedMessage}${stackStr}`); // eslint-disable-line no-console
    } else {
      next(message, options);
    }
  });

  registerHandler(function raiseOnDeprecation(message, options, next) {
    if (ENV.RAISE_ON_DEPRECATION) {
      let updatedMessage = formatMessage(message);

      throw new Error(updatedMessage);
    } else {
      next(message, options);
    }
  });

  missingOptionsDeprecation =
    'When calling `deprecate` you ' +
    'must provide an `options` hash as the third parameter.  ' +
    '`options` should include `id` and `until` properties.';
  missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.';

  missingOptionDeprecation = (id: string, missingOption: string): string => {
    return `When calling \`deprecate\` you must provide \`${missingOption}\` in options. Missing options.${missingOption} in "${id}" deprecation`;
  };
  /**
   @module @ember/debug
   @public
   */

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Update code to stop using the deprecated API named in the message
  2. Set RAISE_ON_DEPRECATION to false if you only want warnings
  3. Filter/ignore specific deprecations with options.id handling via a custom handler

Example fix

// config/environment.js
// before
ENV.RAISE_ON_DEPRECATION = true;
// after
ENV.RAISE_ON_DEPRECATION = false; // or fix the deprecated API usage
Defensive patterns

Strategy: validation

Validate before calling

import { isTesting, registerDeprecationHandler } from '@ember/debug';
// ensure ENV.RAISE_ON_DEPRECATION reflects your intent before app load
if (config.environment === 'test') { /* decide raise vs warn */ }

Type guard

null

Try / catch

try { deprecatedApi(); } catch (e) { if (isDeprecationError(e)) logDeprecation(e.message); else throw e; }

Prevention

When it happens

Trigger: Calling deprecate(msg, ...) (or triggering framework deprecations) while config sets RAISE_ON_DEPRECATION to true (commonly set in tests to enforce no-deprecation policies).

Common situations: CI test suites configured to fail on deprecations (Ember CLI QUnit hooks); running app code that uses a deprecated API in an environment with raise-on-deprecation enabled.

Related errors


AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01). Data as JSON: /api/errors/37050990cf9ea022. Report an issue: GitHub.