AUR0753
Error Message
AUR0753: Attribute <attribute-name> is not registered in <component-name>.
Where <attribute-name>
is the name of the custom attribute used in the template, and <component-name>
is the name of the component whose template is being rendered.
Description
This error occurs during rendering when Aurelia encounters a custom attribute in the template (e.g., <div my-attribute.bind="..."></div>
), but it cannot find the definition for that attribute (my-attribute
) within the resources registered for the current component or globally. This applies to regular custom attributes, not template controllers (which have a separate error code, AUR0754).
Cause
The causes are analogous to those for missing custom elements (AUR0752):
Missing Import: The custom attribute class was not imported into the component's view model file.
Missing
dependencies
Array: The custom attribute was imported but not included in thedependencies
array of the component's definition.Typo in Attribute Name: The name used in the template (e.g.,
my-attrbute
) doesn't match the registered name of the custom attribute (e.g.,my-attribute
). Attribute names are case-insensitive in HTML but often defined with kebab-case.Incorrect Registration: The attribute is defined elsewhere but wasn't correctly registered globally (
Aurelia.register(...)
) or locally viadependencies
.Build/Bundling Issues: The build process failed to include the attribute definition.
Solution
The solutions mirror those for custom elements:
Import the Attribute: Ensure the custom attribute class is imported in the view model file.
Add to Dependencies: Add the imported custom attribute class to the
dependencies
array.import { MyAttribute } from './my-attribute'; import { customElement } from 'aurelia'; @customElement({ name: 'my-component', template: `<div my-attribute></div>`, dependencies: [MyAttribute] // <-- Add here }) export class MyComponent { }
Verify Name: Check the attribute name in the template against its definition (
@customAttribute('my-attribute')
or similar).Check Registration: Ensure proper global or local registration.
Verify Build: Check the build/bundler configuration and output.
Debugging Tips
Check the browser's console for the exact error message.
Verify the import path and the
dependencies
array.Search the codebase for the attribute definition to confirm the name.
Inspect the browser's loaded sources to see if the attribute's code is present.
Last updated
Was this helpful?