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
- Update code to stop using the deprecated API named in the message
- Set RAISE_ON_DEPRECATION to false if you only want warnings
- 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
- Keep RAISE_ON_DEPRECATION false unless running strict deprecation CI
- Fix deprecated API usage flagged in the message promptly
- Register a custom deprecation handler to filter by options.id
- Audit app for deprecations before enabling raise-on-deprecation
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
- The API deprecated by ${options.id} was removed in ember-sou
- A resolved helper cannot be passed as a named argument as th
- deprecation override for ${id} not found
- Cannot call `.lookup('${fullName}')` after the owner has bee
- Cannot call `.factoryFor('${fullName}')` after the owner has
AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01).
Data as JSON: /api/errors/37050990cf9ea022.
Report an issue: GitHub.