# V1005 unresolved_module

URL: /docs/errors/V1005
Markdown: /docs/errors/V1005.md

> An import names a module that does not exist in the snapshot, std, or the declared dependencies.

An error from the `resolve` phase. `sakura explain V1005` prints this explanation offline.

An `import` names a module that does not exist in the snapshot, std, or the declared
dependencies. The first path segment is a package name (`std`, this package, or a dependency);
`compiler/std/INDEX.md` lists std's modules, and a dependency must be declared in `sakura.toml`.

Wrong:

```sakura
import std/nope
```

Fixed:

```sakura
import std/json
```

## Wrong program [#wrong-program]

[`compiler/tests/ui/V1005_unresolved_module.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V1005_unresolved_module.sakura), which the compiler's ui suite runs through `sakura check`:

```sakura
import std/nope

fn one() -> Int { 1 }
```

`sakura check --json` reports this record (pretty-printed; `$DIR` is the fixture's directory):

```json
{
  "schema_version": "1.0",
  "kind": "diagnostic",
  "id": "d:0181cc0ea1827400",
  "code": "V1005",
  "severity": "error",
  "phase": "resolve",
  "message": "package `std` has no module `nope`",
  "snapshot": "sha256:$SNAPSHOT",
  "symbol_id": null,
  "spans": [
    {
      "uri": "file://$DIR/V1005_unresolved_module.sakura",
      "content_hash": "sha256:10af8eccdb2695bd7063b8495f5ba6de4e1ee9fca77baa73a4113509cb7396f6",
      "start_byte": 41,
      "end_byte": 49,
      "role": "primary"
    }
  ],
  "related_ids": [],
  "expected": null,
  "actual": null,
  "obligation": null,
  "counterexample": null,
  "explanation_uri": "sakura://explain/V1005",
  "fixes": []
}
```

## Fixed program [#fixed-program]

[`compiler/tests/ui/V1005_unresolved_module.fixed.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V1005_unresolved_module.fixed.sakura), which `sakura check` accepts with no diagnostics:

```sakura
import std/json

fn one() -> Int { 1 }
```
