[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › typeErrorToIssues

```ts
function typeErrorToIssues<T>(
  type: T,
  error: InferErrors<NoInfer>,
): readonly [TypeIssue, TypeIssue];
```

Defined in: [packages/common/src/Type.ts:1005](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Type.ts#L1005)

Converts an error from a [Type](https://evolu.dev/docs/api-reference/common/Type/interfaces/Type) into formatted issues with paths.

Pass the Type that produced the error. This uses its nested and localized
formatters without validating the input again. To retain every issue, decode
with `{ errors: "all" }`; this function cannot recover errors omitted during
validation. A root issue has an empty path.

### Example

```ts
import {
  assertEqual,
  assertErr,
  IntFromString,
  object,
  typeErrorToIssues,
} from "@evolu/common";

const Settings = object({ port: IntFromString });

const result = Settings.fromUnknown({ port: "http" }, { errors: "all" });
assertErr(result);

assertEqual(typeErrorToIssues(Settings, result.error), [
  {
    path: ["port"],
    message: 'The value "http" is not a decimal integer.',
  },
]);
```