# AUR0018

### **Error message**

Invalid channel name or instance: 'yyyy'.

### **Parameters**

Channel name or instance (string or object)

### Error explanation

This error occurs when you attempt to publish an event using the EventAggregator, but the channel name or instance provided is invalid (e.g., undefined, null, or otherwise not a valid event name or instance). The EventAggregator requires a valid string channel name or a valid instance to publish events.

### Common causes

* Attempting to publish an event with an undefined or null channel name.
* Passing an invalid object or value as the event instance.
* Programming errors where the event name or instance is not set correctly before publishing.

### How to fix

* Ensure you are passing a valid string as the channel name or a valid instance when calling `publish()` on the EventAggregator.
* Check your code for places where the event name or instance might be undefined or null.
* Add validation or error handling to ensure only valid events are published.

### Debugging tips

* Check the stack trace to see where the invalid publish call was made.
* Search your codebase for all calls to `EventAggregator.publish()` and verify the arguments.
* If using plugins, try disabling them one at a time to isolate the source.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurelia.io/developer-guides/error-messages/0001-to-0023/aur0018.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
