---
title: "TS8025 BUILTIN_STAGE: a TypeShade compiler error code"
description: "TS8025 BUILTIN_STAGE, an error code of the TypeShade compiler. A @builtin(...) id used as the input or output of the wrong stage…"
url: https://typeshade.dev/reference/errors/ts8025/
language: en
---

# `TS8025`

Front-end code `BUILTIN_STAGE`

A `@builtin(...)` id used as the input or output of the wrong stage, for example `frag_depth` on a vertex return or `front_facing` on a vertex parameter.

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(i: builtin<"vertex_index">): vec4 {
  return vec4(f32(i), 0., 0., 1.)
}
```

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

**TS8025** error, line 4: Builtin "`vertex_index`" is not a valid fragment input; it is a vertex input.

## How to fix it

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

example.shade.ts

```ts
"use typeshade"

@fragment
export function main(p: builtin<"position">): vec4 {
  return vec4(p.x / 512., 0., 0., 1.)
}
```

## The rule this enforces

**[Rule 6.6](https://typeshade.dev/reference/rules/6-6/) Test**

An entry point’s inputs and outputs are explicit parameters and return values.

## See also

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

## Source

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

- [`src/compiler/ts/builtin-check.ts:424`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-check.ts#L424)
