air-verse/air · error
entrypoint must be a string or array of strings, got %T
Error message
entrypoint must be a string or array of strings, got %T
What it means
The `entrypoint` TOML unmarshaler only supports a string or an array of strings; any other TOML type (integer, table, boolean) is rejected with this error. It fires while decoding the `build.entrypoint` key of the config.
Source
Thrown at runner/config.go:84
case nil:
*e = nil
return nil
case string:
*e = []string{val}
return nil
case []interface{}:
values := make([]string, len(val))
for i, raw := range val {
s, ok := raw.(string)
if !ok {
return fmt.Errorf("entrypoint values must be strings, got %T", raw)
}
values[i] = s
}
*e = values
return nil
default:
return fmt.Errorf("entrypoint must be a string or array of strings, got %T", v)
}
}
func (e entrypoint) binary() string {
if len(e) == 0 {
return ""
}
return e[0]
}
func (e entrypoint) args() []string {
if len(e) <= 1 {
return nil
}
return e[1:]
}
type cfgBuildOverrides struct {View on GitHub (pinned to 71ea1dee05)
Solutions
- Set entrypoint to a string: entrypoint = "./tmp/main"
- Or an array of strings: entrypoint = ["./tmp/main", "arg1"]
- If migrating from `bin`, use entrypoint = ["./tmp/main"] rather than a table
Example fix
// before (.air.toml)
entrypoint = { bin = "./tmp/main" }
// after (.air.toml)
entrypoint = ["./tmp/main"] Defensive patterns
Strategy: validation
Validate before calling
// entrypoint must be a string or array of strings in TOML
// entrypoint = "./tmp/main" ✓
// entrypoint = ["./tmp/main", "-flag"] ✓
// entrypoint = 42 / true / {..} ✗ Prevention
- Only use string or [string] forms for entrypoint
- Do not try to express entrypoint as a table
- Validate the TOML with a linter before running air
When it happens
Trigger: A `.air.toml` with `entrypoint = 42`, `entrypoint = true`, or `entrypoint = {bin="./tmp/main"}` — any value that is neither string nor array — passed to UnmarshalTOML.
Common situations: Migrating from the deprecated `bin` key by writing `entrypoint` as a table; typo-pasting YAML/JSON style config into TOML; missing quotes causing TOML to parse the value as something else.
Related errors
- entrypoint values must be strings, got %T
- configuration already exists
- build.rules[%d] (%s): cmd is required
- build.rules[%d] (%s): at least one of include_dir, include_e
- failed to marshal the default configuration: %w
AI-assisted analysis of air-verse/air@71ea1dee05 (2026-08-31).
Data as JSON: /api/errors/6ea8a39b45e7caca.
Report an issue: GitHub.