# X_DOC_CHANGELOG_SECTION_INVALID

## Means

a `CHANGELOG.md` section is not one section

## Typical cause

two `##` headings name the same version, or a released section has no body. `scripts/release.ts` raises the same code for the third shape, refusing before a manifest is written: an `[Unreleased]` with no body and no commit since the previous tag would ship a version section that says nothing. A fourth sits under the same code in `scripts/changelog-check.ts`: a released section whose body is the auto-generated `### Commits` block alone — what `promoteUnreleased` appends when `[Unreleased]` held no human-written notes — so the release it names shipped no release notes of its own (`[Unreleased]` itself is exempt: its notes are simply not written yet). The release script used to **append** a section generated from commit subjects instead of promoting `[Unreleased]`, and that is what put two `## 5.0.1` headings and two `## 5.0.0` headings in the file — a dateless generated one above the hand-written one, each time. Both pairs sat there from the `release: 5.0.1` commit until `release: 6.0.0` merged them by hand

## Fix

merge the two sections into one, or delete the generated one, then `bun run scripts/changelog-check.ts --json` — it names the line. For the empty case, write the notes under `## [Unreleased]` in `CHANGELOG.md` and run the release again. For the commits-only case, write the human-written release notes for the version the cause names under its heading in `CHANGELOG.md`, above the `### Commits` block, then `bun run scripts/changelog-check.ts --json`

[CLI and verify](/error-codes#cli-and-verify)
