```python
def count_by(records: list, field: str) -> dict:
    """
    Given a list of records (dicts) and a field name, return a dict
    mapping each value of that field to the number of records that hold it.
    Records missing 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
```