# file_too_large

> One module exceeds 2 MiB or one asset exceeds 16 MiB.

One module exceeds 2 MiB or one asset exceeds 16 MiB.

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

A single file is over its size limit: 2 MiB for a module (`.js` or `.ts`),
16 MiB for an asset. The problem names the file and its size.

## Why it happens

Large modules are usually generated data (level tables, embedded images as
base64) pasted into source. Large assets are usually uncompressed audio or
oversized images.

## Wrong

```js title="src/levels.js"
// 3 MB of inline data
export const levels = [/* … */];
```

## Right

```text
src/levels/level1.js
src/levels/level2.js
src/levels/level3.js
```

Split data across modules, or shrink the asset (for example WAV to Ogg). The
package still has to fit within 10 MiB compressed.

## See also

- [Assets](/games/assets)
- [`modules_too_large`](/errors/modules_too_large)
- [`archive_too_large`](/errors/archive_too_large)
