remoteintech/remote-jobs · error
Missing required field: `${field}`
Error message
Missing required field: `${field}` What it means
Loop at lines 108-112 over REQUIRED_FIELDS = [title, slug, website, region, remote_policy, company_size]. A field is 'missing' when it is falsy OR a string that trims to empty. Each missing field emits its own error line naming the offending key, so a single file can produce several.
Source
Thrown at .github/scripts/validate-companies.js:110
content = readFileSync(filePath, "utf-8");
} catch (err) {
errors.push(`Could not read file: ${err.message}`);
return { errors, warnings };
}
// Parse frontmatter
const data = parseFrontmatter(content);
if (!data) {
errors.push(
"Missing YAML frontmatter. The file must start with `---` followed by YAML fields and a closing `---`."
);
return { errors, warnings };
}
// Check required fields
for (const field of REQUIRED_FIELDS) {
if (!data[field] || (typeof data[field] === "string" && !data[field].trim())) {
errors.push(`Missing required field: \`${field}\``);
}
}
// Validate enum values (only if field exists)
if (data.region && !VALID_REGIONS.includes(data.region)) {
errors.push(
`Invalid \`region\`: "${data.region}". Must be one of: ${VALID_REGIONS.join(", ")}`
);
}
if (data.remote_policy && !VALID_REMOTE_POLICIES.includes(data.remote_policy)) {
errors.push(
`Invalid \`remote_policy\`: "${data.remote_policy}". Must be one of: ${VALID_REMOTE_POLICIES.join(", ")}`
);
}
if (data.company_size && !VALID_COMPANY_SIZES.includes(data.company_size)) {
errors.push(View on GitHub (pinned to b1dd8deb19)
Solutions
- Add the named field with a non-empty value.
- Verify the key uses snake_case exactly as listed in REQUIRED_FIELDS.
- Re-run the validator and confirm the field's error line is gone.
Example fix
// before --- title: "Acme" slug: acme --- // after --- title: "Acme" slug: acme website: https://acme.example region: worldwide remote_policy: fully-remote company_size: small ---
Defensive patterns
Strategy: validation
Validate before calling
const REQUIRED_FIELDS = ['title','slug','website','region','remote_policy','company_size'];
function missingFields(data) {
return REQUIRED_FIELDS.filter(f => !data[f] || (typeof data[f] === 'string' && !data[f].trim()));
} Type guard
function hasAllRequiredFields(data) {
return REQUIRED_FIELDS.every(f => data[f] && (!(typeof data[f] === 'string') || data[f].trim()));
} Prevention
- Provide a complete company template in CONTRIBUTING.md with every required key.
- Run a YAML schema validator in your editor on save.
- Use snake_case exactly — never camelCase or kebab-case for these keys (except slug value).
When it happens
Trigger: A required key is omitted entirely; the key is present but empty (`title:`); the value is whitespace-only; the key is misspelled (e.g. `remote-policy` with a hyphen instead of underscore, or camelCase `companySize`).
Common situations: Contributor copies a partial template; YAML key typo from a non-native snake_case user; a field was accidentally commented out; merge tool dropped a line.
Related errors
- Missing YAML frontmatter. The file must start with `---` fol
- Invalid `region`: "${data.region}". Must be one of: ${VALID_
- Invalid `remote_policy`: "${data.remote_policy}". Must be on
- Invalid `company_size`: "${data.company_size}". Must be one
- Invalid technology tag: "${tech}". Valid tags: ${VALID_TECHN
AI-assisted analysis of remoteintech/remote-jobs@b1dd8deb19 (2026-08-13).
Data as JSON: /api/errors/f5986a0e015b87e0.
Report an issue: GitHub.