AUR0719

Error Message

AUR0719: Attribute <attribute> has been already registered for <element>

Where <attribute> is the HTML attribute name (e.g., for) and <element> is the element tag name (e.g., label or * for all elements).

Description

This error indicates an internal inconsistency detected by Aurelia's AttributeMapper. The AttributeMapper is responsible for understanding how HTML attributes should map to component properties (e.g., mapping the readonly attribute to a readOnly property). This error occurs when the mapper detects that a rule attempting to define such a mapping for a specific HTML attribute and element combination has already been registered.

Cause

This error is generally not caused by standard application configuration like defining @bindable properties or using default Aurelia setups. Standard mechanisms handle attribute mapping implicitly. The most likely causes are:

  1. Internal Framework Issue: A potential bug within Aurelia's AttributeMapper or related compilation/configuration services could lead to duplicate registration attempts for the same mapping rule.

  2. Unsupported Internal API Usage: Advanced or non-standard code directly interacting with and attempting to modify the internal AttributeMapper instance during runtime or configuration might inadvertently cause duplicate registrations. Standard application development should not involve direct manipulation of the AttributeMapper.

  3. Plugin Conflict (Rare): In very rare cases, two different plugins attempting low-level manipulation of the AttributeMapper could potentially conflict, although well-behaved plugins should avoid this.

Solution

Since this usually points to an internal issue or unsupported usage:

  1. Update Aurelia Packages: Ensure you are using the latest compatible versions of all Aurelia packages. The issue might be a known bug that has been fixed.

  2. Remove Internal API Usage: If you have any code directly accessing or modifying the AttributeMapper service, remove it. Rely on standard Aurelia mechanisms like @bindable for property mapping.

  3. Check Plugins: If using plugins, especially those performing low-level framework modifications, try temporarily disabling them to see if the error disappears. If a plugin is identified as the cause, report the issue to the plugin author.

  4. Isolate and Reproduce: Try to identify the specific component or scenario that triggers the error. Create the smallest possible reproduction case.

  5. Report the Issue: If you suspect a framework bug after ruling out unsupported API usage and plugin conflicts, report the issue on the Aurelia GitHub repository, providing the minimal reproduction and details about your Aurelia versions.

Debugging Tips

  • Identify the <attribute> and <element> names from the error message. This tells you which mapping rule is being duplicated.

  • Examine the stack trace when the error occurs. This might provide clues about which part of the framework or which plugin is attempting the duplicate registration.

  • Review recent changes to your codebase, especially around application startup configuration, plugins, or any potentially non-standard framework interactions.

  • Search the Aurelia GitHub issues to see if this specific mapping conflict has been reported or resolved previously.

Last updated

Was this helpful?