---
title: "SD0020: module validation failed, a TypeShade error code"
description: "SD0020, an error code of the TypeShade compiler. module validation failed"
url: https://typeshade.dev/reference/errors/sd0020/
language: en
---

# `SD0020`

Core code

module validation failed

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

## In the front end

A `"use typeshade"` file never reaches this check with the same mistake: the front end refuses it first, under its own code. This program, compiled at build time, gets:

example.shade.ts

```ts
"use typeshade"

interface VsOut {
  pos: builtin<"position">
  uv: location<0, vec2>
}

@vertex
export function vs(i: builtin<"vertex_index">): VsOut {
  return { pos: vec4(0., 0., 0., 1.), uv: vec2(0., 0.) }
}

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

**[TS8010](https://typeshade.dev/reference/errors/ts8010/)** error, line 13: fs's parameter "uv" reads `@location(1)`, which "vs" does not produce.

## See also

**[`TS8010`](https://typeshade.dev/reference/errors/ts8010/) `STRUCT_FIELD`**

An invalid struct field or declaration shape. A class with no fields is accepted; this code covers an invalid field declaration, an empty struct that is not a class, an `@align` on a field, which is not applied, and a user-defined value whose uses give it two locations ([Rule 6.6](https://typeshade.dev/reference/rules/6-6/)).

- [WGSL and GLSL](https://typeshade.dev/guide/concepts/wgsl-and-glsl/)
- [`TypeShadeError`](https://typeshade.dev/api/typeshadeerror/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

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

- [`src/core/passes/lint/rules/builtin-value-type.ts:46`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/lint/rules/builtin-value-type.ts#L46)
- [`src/core/passes/lint/rules/interstage-io.ts:170`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/lint/rules/interstage-io.ts#L170)
- [`src/core/passes/validate.ts:64`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/validate.ts#L64)
