# AUR0013

### **Error message**

Cannot call resolve `yyyy` before calling prepare or after calling dispose.

### **Parameters**

name (string)

### Error explanation

This error occurs when `InstanceProvider.resolve()` is called but no instance has been set. This can happen if you try to resolve before calling `prepare(instance)`, or after the provider has been disposed (which clears the instance).

### Common causes

* Calling `resolve()` on an `InstanceProvider` before calling `prepare(instance)`.
* The `InstanceProvider` was disposed (via `dispose()`), clearing the instance before resolve was called.
* The provider was constructed without an initial instance and `prepare()` was never called.

### How to fix

* Always call `prepare(instance)` on the `InstanceProvider` before calling `resolve()`.
* Alternatively, instantiate the `InstanceProvider` with an initial instance as the second parameter.
* Avoid calling `resolve()` after the provider has been disposed.

### Debugging tips

* Check the stack trace to see where `resolve()` was called without an instance.
* Search your codebase for all usages of `InstanceProvider` and ensure `prepare()` is called before `resolve()`.
* If using plugins, try disabling them one at a time to isolate the source.
