---
url: https://akinozgen.github.io/datagrids/errors/DG007.md
description: >-
  One datagrids warning or error code — the message, when it happens and how to
  fix it.
---

# DG007: Required module is missing

```text
[datagrids DG007] Module `{name}` requires `{dep}`, which is not attached.
```

This is a wiring mistake: the grid throws an `Error` with this message instead of half-working.

## When it happens

A module declares `requires: ["…"]` and no module with that name is attached. The check runs after all
modules from the constructor's `use` are attached (thrown by the constructor) and, for `grid.use()`,
in a microtask afterwards (an uncaught error in the console). Built-in case: `button.resetState()`
requires `state`, the module name of `stateSave()`.

## How to fix it

Attach the dependency in the same `use` array; the order inside the array does not matter:

```js
use: [stateSave(), button.resetState()]
```

## Related

* [All warning codes](/errors/)
* [Grid options](/reference/options)
* [Static API & configure()](/reference/static)
