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
- Check the component name in the error message against an actually existing component file/module and fix the name or path
- Register the component in the owner/resolver registry so lookupComponent can find it
- Verify the resolver passed to the runtime implements lookupComponent and that owner is provided
- 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
- Always register dynamically referenced components in the resolver/owner registry
- Add a startup check that verifies all dynamically used component names resolve
- Enable DEBUG builds in development so resolution failures throw early with the component name
- Avoid string-based component names where a direct import is possible
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
- Attempted to resolve `${value}`, which was expected to be a
- Attempted to invoke a component that was not in scope in a s
- You attempted to invoke a path (\`<${resolution.path}>\`) bu
- Compile Error: ${template.problem} @ ${template.span.start}.
- A resolved helper cannot be passed as a named argument as th
AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01).
Data as JSON: /api/errors/4db7d8d82c36986f.
Report an issue: GitHub.