---
title: "TS8072 IMPORT: an error code of the TypeShade compiler"
description: "TS8072 IMPORT, an error code of the TypeShade compiler. An import that the compiler does not follow (Rule 3.9)…"
url: https://typeshade.dev/reference/errors/ts8072/
language: en
---

# `TS8072`

Front-end code `IMPORT`

An import that the compiler does not follow ([Rule 3.9](https://typeshade.dev/reference/rules/3-9/)): a path that names no file or one that this compile cannot read, a file that is not a shader module, a package that no `node_modules` holds, a subpath that a package's `exports` does not name, a name that the module does not export, or a form that a shader module has no use for (a default import or export, an import that names nothing, `import(...)`, `require`).

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"
import { wave } from "./wav.shade.ts"

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

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

**TS8072** error, line 2: Cannot find the shader module "./wav.shade.ts" (looked for "wav.shade.ts").

## How to fix it

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

example.shade.ts

```ts
"use typeshade"
import { wave } from "./wave.shade.ts"

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

It imports from another file of the same program, which `compile()` reads through its `readDocument` option:

wave.shade.ts

```ts
"use typeshade"

export function wave(p: vec2): f32 {
  return sin(p.x * 6.) * cos(p.y * 6.) * 0.5 + 0.5
}
```

## The rule this enforces

**[Rule 3.9](https://typeshade.dev/reference/rules/3-9/) Test**

A shader file may import what another shader file exports, by a relative specifier or, from a package, by the package’s name; the file a compile starts from and every shader file it imports, directly or through another, are one program, which emits one module, and each file keeps the scope TypeScript gives it.

## 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/link.ts:52`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/link.ts#L52) (2 sites)
- [`src/compiler/ts/semantic.ts:124`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/semantic.ts#L124)
