# Troubleshooting

Start with `dryv doctor`, then `dryv build` for compile errors with source locations, then `dryv validate` for engine checks. Use `--json --no-input` to read structured diagnostics.

| Symptom                                        | Likely cause                                                                        | Fix                                                                                              |
| ---------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `Cannot reference an unregistered declaration` | A raw `property.*()` or `schema()` was passed to `field(...)`                       | Register it on a group first: `const values = group.properties({ Id })`, then `field(values.Id)` |
| Compile error on `enum` or `namespace`         | Node strips types but does not compile them                                         | Use string-literal unions or `property.enum({...})`                                              |
| `DRYV_TRUST_REQUIRED`                          | Your compiler is project code and has not been trusted                              | Run `dryv trust` once in the project (CI never trusts automatically)                             |
| Author or compiler "incompatible"              | Mismatched versions                                                                 | Install matching versions of the author and compiler (`>=0.1.0 <0.2`)                            |
| Identity contains `.`                          | A group, app or registration name has a dot                                         | Rename it; `.` is reserved for compiler qualification                                            |
| Operation fails validation                     | More than one input or output                                                       | Use one schema or named fields as the input, and one output                                      |
| Scoped operation rejected                      | The target is not a persisted field, or the policy does not provide the named value | Check [Scoped operations](/authoring/cookbook/scoped-operations)                                 |
| `unknown command 'context'`                    | An older global `dryv`                                                              | Update the CLI: see [CLI for pack builders](/pack-builders/cli)                                  |

## Reading a diagnostic

Diagnostics carry a stable code, the artifact (your contract file), a source location and a human message. `dryv explain change` and `dryv why <path>` explain _generation_; they do not explain compile errors. For compile errors, fix the line the diagnostic points to, then run `dryv build` again.
