# TS2359: The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method.

> The right side of `instanceof` isn't a class or constructor. Use a class, or another kind of check.

## What it means

`x instanceof Y` needs `Y` to be a constructor (or an object with `Symbol.hasInstance`).
Interfaces and type aliases don't exist at runtime, and a plain value can't be used.

## Example

```ts
const shape = { kind: "circle" };

export const ok = {} instanceof shape;
```

## How to fix

- Use a class on the right.
- To test against an interface, check a discriminant or properties, or write a type guard.

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