# AUR0014

### **Error message**

Key cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI? A common cause is circular dependency with bundler, did you accidentally introduce circular dependency into your module graph?

### Error explanation

This error occurs when a `null` or `undefined` key is used in a DI container operation, such as `container.get(key)` or `container.register(key, ...)`. Dependency Injection keys must always be defined and valid.

### Common causes

* A circular dependency or bundler issue (e.g., Webpack) results in a key being `undefined` at runtime.
* A typo or incorrect import leads to a missing or undefined key.
* Attempting to register or resolve a dependency before it is defined.
* Plugins or libraries that incorrectly provide a null/undefined key.

### How to fix

* Ensure all keys used in DI registration and resolution are defined and not null/undefined.
* Check for circular dependencies in your module graph, especially with bundlers.
* Double-check imports and the order of registration.
* If using plugins, ensure they are not introducing null/undefined keys.

### Debugging tips

* Check the stack trace to see where the null/undefined key was used.
* Search your codebase for all registrations and resolutions of the key in question.
* If using a bundler, look for circular dependencies or import issues.
* 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/aur0014.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.
