emberjs/ember.js · error · Error

PromiseProxy's promise must be set

Error message

PromiseProxy's promise must be set

What it means

PromiseProxyMixin defines 'promise' as a computed property whose getter throws if the proxy has no promise set. Reading isPending/isRejected/isFulfilled or the promise property on a PromiseProxy (e.g. PromiseProxyMixin.extend({}).create() or an ObjectProxy wrapping nothing) before assigning a promise hits this error.

Source

Thrown at packages/@ember/object/promise-proxy-mixin.ts:232

}
const PromiseProxyMixin = Mixin[INTERNAL_MIXIN_CREATE]({
  reason: null,

  isPending: computed('isSettled', function () {
    return !get(this, 'isSettled');
  }).readOnly(),

  isSettled: computed('isRejected', 'isFulfilled', function () {
    return get(this, 'isRejected') || get(this, 'isFulfilled');
  }).readOnly(),

  isRejected: false,

  isFulfilled: false,

  promise: computed({
    get() {
      throw new Error("PromiseProxy's promise must be set");
    },
    set(_key, promise: RSVP.Promise<unknown>) {
      return tap(this, promise);
    },
  }),

  then: promiseAlias('then'),

  catch: promiseAlias('catch'),

  finally: promiseAlias('finally'),
});

function promiseAlias<T, N extends MethodNamesOf<Promise<T>>>(name: N) {
  return function (this: PromiseProxyMixin<T>, ...args: Parameters<Promise<T>[N]>) {
    let promise = get(this, 'promise');

    // We need this cast because `Parameters` is deferred so that it is not

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Always create with a promise: PromiseProxy.create({ promise: somePromise })
  2. Guard template/computed access with proxy.promise before reading state flags
  3. Set the promise property via set() which taps the promise automatically

Example fix

// before
let proxy = ObjectProxy.extend(PromiseProxyMixin).create();
// after
let proxy = ObjectProxy.extend(PromiseProxyMixin).create({ promise: loadData() });
Defensive patterns

Strategy: validation

Validate before calling

let proxy = ObjectProxy.extend(PromiseProxyMixin).create({ promise });
// guard reads:
if (proxy.get('promise')) { useProxyState(proxy); }

Type guard

function hasPromiseSet(proxy) { try { proxy.get('promise'); return true; } catch { return false; } }

Try / catch

try { state = proxy.get('isFulfilled'); } catch (e) { if (!/promise must be set/.test(e.message)) throw e; state = null; }

Prevention

When it happens

Trigger: Accessing proxy.promise or proxy.isPending/isRejected/isFulfilled on a proxy created without an initial promise; passing a non-promise or forgetting to set promise in create({ promise: ... }).

Common situations: Computed properties reading isFulfilled before the async load assigns the promise; templates rendering proxy state before setup; create() called without the promise argument.

Related errors


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