Cannot find component: c:myComponent
The Lightning runtime tried to instantiate a component by name and the platform doesn't have it — the bundle didn't deploy, the namespace prefix is wrong, or you're loading a managed-package component without the package installed.
Also seen asCannot find component·Component definition not found·markup://c: not found
Lightning resolves component references by namespace + name. If either piece is wrong, the runtime can't find the bundle and throws this error. The user-facing message is generic; debugging requires checking three things.
Check 1: is the bundle deployed?
sf data query --query "SELECT Id, MasterLabel, FilePath FROM AuraDefinitionBundle WHERE DeveloperName = 'myComponent'" --target-org production
For LWC:
sf data query --query "SELECT Id, MasterLabel, NamespacePrefix FROM LightningComponentBundle WHERE DeveloperName = 'myComponent'" --target-org production --use-tooling-api
If the query returns no rows, the component isn't in the org. Deploy it.
Check 2: is the namespace right?
Component references use <namespace>:<name>:
| Reference | Namespace |
|---|---|
c:myComponent | Local org components (default c namespace) |
myPackage:doStuff | Components from managed package myPackage |
lightning:button | Built-in Salesforce Lightning components |
If your code references c:doStuff but the component is in the myPackage namespace, the platform rejects it. Check the component's namespace prefix in Setup → Lightning Components.
Check 3: is the component visible to this app?
Lightning components have target declarations. If your component's metadata says lightning__RecordPage but you're trying to use it on a lightning__AppPage, the platform refuses to render.
Open the component's .js-meta.xml (LWC) or .cmp-meta.xml (Aura). The <targets> section tells you where it can render.
For dynamic instantiation via $A.createComponent (Aura), the parent component must declare it as a dependency in dependency markup, or the platform refuses.
When the message names a built-in component
Sometimes you get this error for built-in components like lightning:datatable. Two suspects:
- API version mismatch —
lightning:datatablewas added in a specific API version. If your component's API version is older, the framework can't find it. Bump the component's API version. - Namespace conflict — a managed package may have shadowed a built-in component. Check installed packages.
A common cause during development
You renamed an LWC bundle on disk (oldName/ → newName/) but kept references using the old name. The deploy succeeds; the runtime fails. Rename references in the same deploy.
VS Code's "Find All References" + project-wide rename keeps this in sync.
