---
title: "U1003: Import cycle"
url: https://una-lang.org/en/docs/errors/U1003/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U1003.md
---

# U1003: Import cycle

Modules form a graph through their imports, and that graph has no cycle: a module cannot import, directly or through other modules, a module that imports it. U1003 is reported once per cycle, at the first import of the cycle's first module in path order, and names every module of the cycle. Move the declarations that both sides need into a module that both import.

## Failing example

`src/a.una`

```una
module a

import b (two)

pub one() -> Int = 1

pub three() -> Int = two() + 1
```

`src/b.una`

```una
module b

import a (one)

pub two() -> Int = one() + 1
```

## Fixed example

`src/a.una`

```una
module a

import b (two)

pub three() -> Int = two() + 1
```

`src/b.una`

```una
module b

import c (one)

pub two() -> Int = one() + 1
```

`src/c.una`

```una
module c

pub one() -> Int = 1
```
