# V8006 manifest_invalid

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

> sakura.toml is not a valid manifest (design §17.239): the TOML is malformed, a key is unknown, a value has the wrong type, or [package] has no name.

An error from the `package` phase. `sakura explain V8006` prints this explanation offline.

sakura.toml is not a valid manifest (design §17.239): the TOML is malformed, a key is unknown,
a value has the wrong type, or `[package]` has no `name`. The message is the parser's and the span
points at the key, the value or the syntax error. Nothing builds or runs until it is fixed. The
manifest has `[package]` (`name`, `version`, `edition`), `[permissions]` and `[verify]`; any other
table, `[targets]` included, is unknown. `[dependencies]` is `V8005` instead.

Wrong:

```toml
[package]
name = "billing"
[targets]
```

Fixed:

```toml
[package]
name = "billing"
```

## Wrong program [#wrong-program]

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

`main.sak`:

```sakura
// An unknown table is `V8006` at its name; `[targets]` is not a manifest table (design §17.239).
pub fn main() -> Unit ! {Console} { Console.print("hi") }
```

`sakura.toml`:

```toml
[package]
name = "billing"

[targets]
js = {}
```

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

```json
{
  "schema_version": "1.0",
  "kind": "diagnostic",
  "id": "d:ed70c940fd1c30a7",
  "code": "V8006",
  "severity": "error",
  "phase": "package",
  "message": "unknown field `targets`, expected one of `package`, `permissions`, `verify`",
  "snapshot": "sha256:$SNAPSHOT",
  "symbol_id": null,
  "spans": [
    {
      "uri": "file://$DIR/V8006_manifest_has_targets_table/sakura.toml",
      "content_hash": "sha256:679ace2325562c0ca9606d51174dbad596c3deff23eab3fce77373ea69f144b2",
      "start_byte": 29,
      "end_byte": 36,
      "role": "primary"
    }
  ],
  "related_ids": [],
  "expected": null,
  "actual": null,
  "obligation": null,
  "counterexample": null,
  "explanation_uri": "sakura://explain/V8006",
  "fixes": []
}
```

## Fixed program [#fixed-program]

No fixed program is checked in for this code yet; the explanation above describes the repair.
