TS8001
On this page

TS8001

Front-end code MISSING_DIRECTIVE

A file compiled as TypeShade that has no "use typeshade" directive at all.

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
@fragment
export function main(@location(0) uv: vec2): vec4 {
return vec4(uv, 0., 1.)
}

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

TS8001 error, line 1: Missing "use typeshade" directive. Add "use typeshade"; at the top level to mark this file for TypeShade compilation.

How to fix it

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

example.shade.ts
"use typeshade"
@fragment
export function main(@location(0) uv: vec2): vec4 {
return vec4(uv, 0., 1.)
}

The rule this enforces

Rule 3.1 Test
A shader file must begin with the directive "use typeshade" as its first statement.

See also

Source

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

Edit this page Report a problem