```python
def count_by(records: list, field: str) -> dict:
    """Return how many records hold each value of one named field.

    Records lacking the field are skipped. An empty field name raises ValueError.
    """
    if not field:
        raise ValueError("Field name must not be empty")

    counts = {}
    for record in records:
        if field in record:
            value = record[field]
            counts[value] = counts.get(value, 0) + 1
    return counts
```