---
title: "TS8013 HOST_STMT: an error code of the TypeShade compiler"
description: "TS8013 HOST_STMT, an error code of the TypeShade compiler. Host control flow and JavaScript runtime forms that no shader has: await, yield…"
url: https://typeshade.dev/reference/errors/ts8013/
language: en
---

# `TS8013`

Front-end code `HOST_STMT`

Host control flow and JavaScript runtime forms that no shader has: `await`, `yield`, an `async` or generator function, `try`/`catch`/`throw`, `for…in`, `var`, a spread outside an object literal and a template string. A `new` is a class rule, `CLASS_MEMBER`.

The registry has no documentation comment for this constant, so the line above is written by this site from the messages the compiler raises it with.

The registry text and every compiler message on these pages are the compiler's own English.

## Example

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  try {
    return vec4(uv, 0., 1.)
  } catch (e) {
    return vec4(0., 0., 0., 1.)
  }
}
```

Compiled at build time against the pinned compiler, this program gets:

**TS8013** error, line 5: try/catch/throw are JS exceptions. TypeShade has no exception path.

## How to fix it

The same program, corrected. It compiles with no diagnostic.

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(uv: location<0, vec2>): vec4 {
  return vec4(uv, 0., 1.)
}
```

## See also

- [Language guide](https://typeshade.dev/guide/language/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

Where the compiler raises this code at commit af54ddad5, one line per file:

- [`src/compiler/ts/lower/control/for-of.ts:30`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/control/for-of.ts#L30)
- [`src/compiler/ts/semantic.ts:143`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/semantic.ts#L143) (11 sites)
