emberjs/ember.js · error · Error

Attempted to resolve `${name}`, which was expected to be a c

Error message

Attempted to resolve `${name}`, which was expected to be a component, but nothing was found.

What it means

resolveComponent looks up a component definition via the resolver (resolver.lookupComponent). When the resolver returns null/undefined, Glimmer cannot render the component, so in DEBUG builds it throws this error naming the unresolved component. In production (non-DEBUG) the throw is skipped and a null definition is passed on, which typically fails later or silently.

Source

Thrown at packages/@glimmer/runtime/lib/component/resolve.ts:24

  Owner,
  ResolutionTimeConstants,
} from '@glimmer/interfaces';
import { expect } from '@glimmer/debug-util/lib/platform-utils';

export function resolveComponent(
  resolver: Nullable<ClassicResolver>,
  constants: ResolutionTimeConstants,
  name: string,
  owner: Owner | null
): Nullable<ComponentDefinition> {
  let definition =
    resolver?.lookupComponent?.(
      name,
      expect(owner, 'BUG: expected owner when looking up component')
    ) ?? null;

  if (DEBUG && !definition) {
    throw new Error(
      `Attempted to resolve \`${name}\`, which was expected to be a component, but nothing was found.`
    );
  }

  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
  return constants.resolvedComponent(definition!, name);
}

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Check the component name in the error message against an actually existing component file/module and fix the name or path
  2. Register the component in the owner/resolver registry so lookupComponent can find it
  3. Verify the resolver passed to the runtime implements lookupComponent and that owner is provided
  4. Rebuild the app so newly added components are included in the resolver manifest

Example fix

// before
{{component 'blog-post'}}  // blog-post.js does not exist
// after
{{component 'post'}}  // or create components/blog-post.js
Defensive patterns

Strategy: validation

Validate before calling

const definition = resolver?.lookupComponent?.(name, owner);
if (!definition) throw new Error(`Component "${name}" is not registered with the resolver`);

Type guard

function componentResolvable(resolver: unknown, name: string, owner: unknown): boolean {
  return typeof (resolver as any)?.lookupComponent === 'function'
    && !!resolver.lookupComponent(name, owner);
}

Prevention

When it happens

Trigger: Dynamic component resolution (e.g. {{component "name"}} or curried component resolution) with a name that the configured resolver cannot find: the component file doesn't exist, isn't exported with the expected name, or the resolver/registry wasn't configured for that name.

Common situations: Typo in a dynamically resolved component name; component not registered in the owner's registry; missing resolver in a standalone @glimmer/runtime setup; component file added but build pipeline not re-run; kolba/embedded Glimmer apps where lookupComponent is a no-op or partial.

Related errors


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