# TS1163: A 'yield' expression is only allowed in a generator body.

> A `yield` expression appears outside a generator function, for example in a nested normal function. Make the function a generator, or move the `yield`.

## What it means

`yield` only works directly inside a generator (`function*` or a `*` method). A normal
function nested inside a generator doesn't count: its body isn't part of the generator.

## Example

```ts
export function* g() {
  function inner() {
    yield 1;
  }
}
```

## How to fix

- Mark the enclosing function as a generator: `function* inner()`, and delegate with `yield* inner()`.
- Or move the `yield` into the generator's own body.

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