# too_many_modules

> The package contains more than 512 modules.

The package contains more than 512 modules.

| | |
| --- | --- |
| Kind | Build or validation problem |
| Reported by | Archive and source validation |
| `disko` exit code | 1 (problems) |

The package has more than 512 modules. Every `.js` or `.ts` file the build
reaches from the entry counts, and so does every `.js` file in an archive.

## Why it happens

Very fine-grained file layouts, such as one module per level or per small
helper, add up quickly.

## Wrong

```text
src/levels/level001.js
src/levels/level002.js
…
src/levels/level600.js
```

## Right

```text
src/levels/pack1.js
src/levels/pack2.js
src/levels/pack3.js
```

Merge small modules so the total stays at 512 or fewer.

## See also

- [Project structure & imports](/games/project-structure)
- [`modules_too_large`](/errors/modules_too_large)
