emberjs/ember.js · error · Error

You attempted to use @cached(), which is not necessary nor s

Error message

You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!

What it means

Error "You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!" thrown in emberjs/ember.js.

Source

Thrown at packages/@ember/-internals/metal/lib/cached.ts:127

  }
  if (DEBUG && (!('get' in descriptor) || typeof descriptor.get !== 'function')) {
    throwCachedGetterOnlyError(key);
  }

  const caches = new WeakMap();
  const getter = descriptor.get;

  descriptor.get = function (): unknown {
    if (!caches.has(this)) {
      caches.set(this, createCache(getter.bind(this)));
    }

    return getValue(caches.get(this));
  };
};

function throwCachedExtraneousParens(): never {
  throw new Error(
    'You attempted to use @cached(), which is not necessary nor supported. Remove the parentheses and you will be good to go!'
  );
}

function throwCachedGetterOnlyError(key: string): never {
  throw new Error(`The @cached decorator must be applied to getters. '${key}' is not a getter.`);
}

function throwCachedInvalidArgsError(args: unknown[] = []): never {
  throw new Error(
    `You attempted to use @cached on with ${
      args.length > 1 ? 'arguments' : 'an argument'
    } ( @cached(${args
      .map((d) => `'${d}'`)
      .join(
        ', '
      )}), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@cached`'}`
  );

View on GitHub (pinned to 26f97246a8)

When it happens

Trigger: Thrown at packages/@ember/-internals/metal/lib/cached.ts:127 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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