# AUR0088

### **Error message**

AttributeParser is already initialized; cannot add patterns after initialization.

### **Parameters**

None

### Error explanation

This error occurs when you attempt to register a new attribute pattern (`IAttributeParser.registerPattern`) after the attribute parser has already been initialized. Initialization happens automatically the first time an attribute is parsed (`IAttributeParser.parse`). Once initialized, the parser's patterns are fixed and cannot be changed.

### Common causes

* Trying to register attribute patterns dynamically after the application has started compiling templates.
* Calling `IAttributeParser.registerPattern` in response to an event or user action after initial template compilation.

### How to fix

* Ensure all attribute patterns are registered before any template compilation begins. The best place for this is typically during application startup or configuration.
* Register patterns via the `@attributePattern` decorator or by providing them to the container configuration, rather than calling `registerPattern` manually after initialization.

### Debugging tips

* Check the stack trace to identify where the late registration attempt is happening.
* Verify the order of operations during application startup to ensure patterns are registered before parsing/compilation starts.
