# TS18047: '…' is possibly 'null'.

> A value that may be `null` is used without a check. Handle the `null` case first.

## What it means

With `strictNullChecks` (part of `strict`), a value whose type includes `null` can't be
dereferenced or called directly. The checker follows `if` checks, `?.` and early returns, so
the error means no check covers this use.

## Example

```ts
export function length(s: string | null) {
  return s.length;
}
```

## How to fix

- Check it: `if (s === null) return 0;`.
- Use optional chaining and a default: `s?.length ?? 0`.

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