# TS18046: '…' is of type 'unknown'.

> A value of type `unknown` is used as if it had a known type. Narrow it with a check first.

## What it means

`unknown` means the value could be anything, so the checker won't let you call it, read
properties from it or use it in arithmetic until you've narrowed it. Values typed `unknown`
commonly come from `catch` clauses (with `strict`) and from parsing external data.

## Example

```ts
export function message(err: unknown) {
  return err.message;
}
```

## How to fix

- Narrow first: `if (err instanceof Error) return err.message;`.
- Check its shape with `typeof`, `in` or a type guard before using it.
- Validate parsed data against the type you expect rather than asserting it with `as`.

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