---
title: "TS8072 IMPORT: TypeShade 컴파일러가 진단에 붙이는 오류 코드와 그 뜻, 고치는 법"
description: "TS8072 IMPORT, TypeShade 컴파일러의 오류 코드입니다. 컴파일러가 따라가지 않는 import입니다(규칙 3.9)."
url: https://typeshade.dev/ko/reference/errors/ts8072/
language: ko
---

# `TS8072`

프런트엔드 코드 `IMPORT`

컴파일러가 따라가지 않는 import입니다([규칙 3.9](https://typeshade.dev/ko/reference/rules/3-9/)). 파일을 가리키지 않거나 이 컴파일이 읽을 수 없는 경로, 셰이더 모듈이 아닌 파일, `node_modules`에 없는 패키지, 패키지의 `exports`가 이름 붙이지 않은 하위 경로, 모듈이 내보내지 않는 이름, 셰이더 모듈에 쓸모없는 형태(기본 import나 export, 아무것도 가져오지 않는 import, `import(...)`, `require`)가 그렇습니다.

레지스트리에는 이 상수에 대한 문서 주석이 없습니다. 그래서 위 설명은 컴파일러가 이 코드와 함께 내는 메시지를 보고 이 사이트가 쓴 것입니다.

레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

## 예제

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

빌드할 때 고정된 컴파일러로 이 프로그램을 컴파일하면 다음 진단이 나옵니다.

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

## 고치는 법

같은 프로그램을 고친 모습입니다. 진단 없이 컴파일됩니다.

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

같은 프로그램의 다른 파일에서 가져오며, `compile()`은 그 파일을 `readDocument` 옵션으로 읽습니다.

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
}
```

## 이 코드가 적용하는 규칙

**[규칙 3.9](https://typeshade.dev/ko/reference/rules/3-9/) 테스트**

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.

## 함께 보기

- [언어 가이드](https://typeshade.dev/ko/guide/language/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

커밋 af54ddad5에서 컴파일러가 이 코드를 내는 곳입니다. 파일마다 한 줄씩 적었습니다.

- [`src/compiler/ts/link.ts:52`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/link.ts#L52) (2곳)
- [`src/compiler/ts/semantic.ts:124`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/semantic.ts#L124)
