---
title: "TS8028 ATTRIBUTE_NAME: a TypeShade compiler error code"
description: "TS8028 ATTRIBUTE_NAME, an error code of the TypeShade compiler. A decorator or an entry form that this surface does not read…"
url: https://typeshade.dev/reference/errors/ts8028/
language: en
---

# `TS8028`

Front-end code `ATTRIBUTE_NAME`

A decorator or an entry form that this surface does not read: an identifier outside the attribute vocabulary (`@vertex`, `@fragment`, `@compute`, `@builtin`, `@location`), such as a misspelled `@vertx`; a WGSL attribute that the surface writes another way or does not borrow, such as a written `@diagnostic(…)`; a stage written as a call, such as `vertex(f)`; an entry that is written in a form that [Rule 8.1](https://typeshade.dev/reference/rules/8-1/) refuses, such as `export default`; or a decorator on a declaration or in a place that takes none ([Rule 6.7](https://typeshade.dev/reference/rules/6-7/)). Without this code the decorated function or field would silently stop being an entry point or an I/O field.

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"

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

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

**TS8028** error, line 3: a stage is an attribute on the function declaration: write "`@fragment` export function main(…)", or run "tshc migrate" (change 0130)

## 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.)
}
```

## The rules this enforces

**[Rule 1.4](https://typeshade.dev/reference/rules/1-4/) Test**

Where ECMAScript has a form that carries the GPU meaning, the surface must borrow TypeScript’s spelling; a WGSL spelling is borrowed only where no ECMAScript spelling carries the meaning, and the borrowing must keep every WGSL capability reachable ([Rule 11.14](https://typeshade.dev/reference/rules/11-14/)).

**[Rule 1.8](https://typeshade.dev/reference/rules/1-8/) Test**

A construct of the language is written in the language’s own syntax: the directive, a type of the surface, or an attribute `@name` or `@name(…)` on the declaration it marks.

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

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

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

The attribute names the compiler reads are `vertex`, `fragment`, `compute`, `workgroup_size`, `builtin`, `location`, `interpolate`, `invariant` and `blend_src` (the last three since [#168](https://github.com/typeshade/typeshade/issues/168), surface §53).

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

The byte layout the emitted module assumes for a resource and the layout `reflect()` reports must agree byte for byte, under WGSL’s uniform and storage layout rules, and so must the layout the manifest carries ([Rule 11.10](https://typeshade.dev/reference/rules/11-10/)); a vertex entry’s vertex buffer is one layout, its `@location` inputs tightly packed in the order written and numbered in that order where no `location<n, T>` states the number ([Rule 6.6](https://typeshade.dev/reference/rules/6-6/)), which `reflect().vertex` and the manifest both report.

**[Rule 8.1](https://typeshade.dev/reference/rules/8-1/) Test**

An entry point is a function declaration at the top of the file or of a namespace, exported or not, with exactly one stage attribute written before the declaration: `@vertex export function vs(…)`, `@fragment …`, or `@compute([x, y?, z?]) …`.

**[Rule 8.5](https://typeshade.dev/reference/rules/8-5/) Test**

A collective operation (a derivative, an implicit-LOD texture sample, a barrier) must be in uniform control flow.

**[Rule 8.22](https://typeshade.dev/reference/rules/8-22/) Test**

A kernel function is an exported function that is not an entry point, a function declaration, and takes at least one array with no size (`array<T>`) or one 2D storage texture (`texture_storage_2d<F, A>`, change 0077), or returns an array with no size that its body makes ([Rule 8.23](https://typeshade.dev/reference/rules/8-23/), change 0114, S5); a sampled texture alone does not make one, so an exported helper that reads one stays a helper an entry calls; its candidate loops are the `for` and `for…of` statements at the top level of its body, and no other loop is ever a candidate.

**[Rule 8.25](https://typeshade.dev/reference/rules/8-25/) Test**

An object parameter that its function writes is the caller’s object, and the call passes the variable itself, unmarked: reading the parameter reads that object, and assigning to a field or an element of it writes it, for the call (change 0142).

## 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:63`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-check.ts#L63) (5 sites)
- [`src/compiler/ts/builtin-check/unread-site.ts:102`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-check/unread-site.ts#L102)
- [`src/compiler/ts/builtin-type-form.ts:80`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/builtin-type-form.ts#L80)
- [`src/compiler/ts/decorated-form.ts:150`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/decorated-form.ts#L150) (2 sites)
- [`src/compiler/ts/lower/expression-call.ts:532`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/expression-call.ts#L532)
- [`src/compiler/ts/lower/function-signature/parameters.ts:289`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/parameters.ts#L289)
- [`src/compiler/ts/lower/function-signature/stage.ts:147`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/stage.ts#L147) (2 sites)
- [`src/compiler/ts/lower/function-signature/workgroup.ts:116`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function-signature/workgroup.ts#L116) (2 sites)
- [`src/compiler/ts/lower/return-location.ts:41`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/return-location.ts#L41) (2 sites)
- [`src/compiler/ts/stage-call.ts:229`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/stage-call.ts#L229)
- [`src/core/coverage/wgsl/attributes.ts:158`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/coverage/wgsl/attributes.ts#L158)
- [`src/language-service/diagnostics/refusal-tables.ts:9`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/diagnostics/refusal-tables.ts#L9)
- [`src/language-service/diagnostics/refused-attributes.ts:22`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/language-service/diagnostics/refused-attributes.ts#L22) (3 sites)
