# TS1128: Declaration or statement expected.

> The parser expected the start of a declaration or statement but found something else, often an extra closing brace.

## What it means

At the top level of a file or a block, each item must be a statement or declaration. This is
reported when a token can't start one, most often a `}` with no matching `{`, or leftover text
after an edit.

## Example

```ts
export function f() {}
}
```

## How to fix

- Remove the extra `}` or other stray text.
- Check that braces above the reported line are balanced.

Source: https://ts-r.dev/errors/TS1128/
