remoteintech/remote-jobs · error

Invalid `region`: "${data.region}". Must be one of: ${VALID_

Error message

Invalid `region`: "${data.region}". Must be one of: ${VALID_REGIONS.join(", ")}

What it means

Enum check at lines 115-119. If data.region is truthy but not in VALID_REGIONS (Object.keys of labels().region from src/_data/labels.js), the value is rejected. The allowed list is sourced from the same labels.js the site renders from, so adding a region there automatically widens validation.

Source

Thrown at .github/scripts/validate-companies.js:117

  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(
      `Invalid \`company_size\`: "${data.company_size}". Must be one of: ${VALID_COMPANY_SIZES.join(", ")}`
    );
  }

  // Validate technologies array
  if (data.technologies && Array.isArray(data.technologies)) {
    for (const tech of data.technologies) {

View on GitHub (pinned to b1dd8deb19)

Solutions

  1. Read the allowed list straight from the error message (it joins VALID_REGIONS).
  2. Set `region:` to one of those exact keys (case-sensitive).
  3. If a genuinely new region is needed, add it to labels().region in src/_data/labels.js first so validation widens with the site.

Example fix

// before
region: global
// after
region: worldwide
Defensive patterns

Strategy: validation

Validate before calling

import labels from '../../src/_data/labels.js';
const VALID_REGIONS = Object.keys(labels().region);
function validRegion(value) {
  return VALID_REGIONS.includes(value);
}

Type guard

function isRegion(value) {
  return typeof value === 'string' && Object.keys(labels().region).includes(value);
}

Prevention

When it happens

Trigger: Contributor invents a value like 'global', 'us', or 'ww' instead of an allowed key such as 'worldwide' or 'americas'; casing error ('Worldwide'); a region key was renamed in labels.js but the profile wasn't updated.

Common situations: Copy-paste from a different directory using a different convention; outdated third-party example; rebrand/refactor of region taxonomy in labels.js.

Related errors


AI-assisted analysis of remoteintech/remote-jobs@b1dd8deb19 (2026-08-13). Data as JSON: /api/errors/82230dfa538d6beb. Report an issue: GitHub.