chenglou/pretext · error · Error

Unsupported browser ${browser}

Error message

Unsupported browser ${browser}

What it means

parseBrowsers accepts a comma-separated --browser= list (default chrome,safari) and validates each entry against {chrome, safari, firefox}. Throws on anything else. Note: 'firefox' passes parsing here but is then rejected at runtime by runBrowser (error 86) because the symbol oracle page automation is not wired for Firefox. So --browser=firefox will pass this check and fail later. 'chromium' and 'webkit' are not accepted tokens.

Source

Thrown at scripts/symbol-check.ts:70

  const raw = parseStringFlag(name)
  if (raw === null) return fallback
  const parsed = Number.parseInt(raw, 10)
  if (!Number.isFinite(parsed)) throw new Error(`Invalid value for --${name}: ${raw}`)
  return parsed
}

function parseBrowsers(value: string | null): AutomationBrowserKind[] {
  const raw = (value ?? 'chrome,safari').trim()
  if (raw.length === 0) return ['chrome', 'safari']

  const browsers = raw
    .split(',')
    .map(part => part.trim().toLowerCase())
    .filter(Boolean)

  for (const browser of browsers) {
    if (browser !== 'chrome' && browser !== 'safari' && browser !== 'firefox') {
      throw new Error(`Unsupported browser ${browser}`)
    }
  }

  return browsers as AutomationBrowserKind[]
}

const requestedPort = parseNumberFlag('port', 0)
const browsers = parseBrowsers(parseStringFlag('browser'))
const timeoutMs = parseNumberFlag('timeout', 60_000)

function printCaseResult(browser: AutomationBrowserKind, testCase: ProbeOracleCase, report: ProbeReport): void {
  if (report.status === 'error') {
    console.log(`${browser} | ${testCase.label}: error: ${report.message ?? 'unknown error'}`)
    return
  }

  const sensitivity =
    report.extractorSensitivity === null || report.extractorSensitivity === undefined

View on GitHub (pinned to ac49b09b7d)

Solutions

  1. Use only chrome, safari, firefox tokens (comma-separated, case-insensitive).
  2. Drop firefox if you need results: symbol runs fail for Firefox (error 86). The default chrome,safari is the supported set.
  3. The message echoes the offending token.

Example fix

# before
bun run scripts/symbol-check.ts --browser=chromium,webkit

# after
bun run scripts/symbol-check.ts --browser=chrome,safari
Defensive patterns

Strategy: validation

Validate before calling

const ACCEPTED = new Set(['chrome', 'safari', 'firefox'])
const tokens = (parseStringFlag('browser') ?? 'chrome,safari')
  .split(',').map(s => s.trim().toLowerCase()).filter(Boolean)
const bad = tokens.filter(t => !ACCEPTED.has(t))
if (bad.length > 0) {
  console.error(`--browser accepts chrome|safari|firefox only, got ${JSON.stringify(bad)}`)
  process.exit(2)
}

Type guard

const ACCEPTED = new Set(['chrome', 'safari', 'firefox'])
const isAcceptedToken = (s: string): s is 'chrome' | 'safari' | 'firefox' =>
  ACCEPTED.has(s)

Prevention

When it happens

Trigger: --browser=edge; --browser=chrome,ie; --browser=chromium (use chrome instead); a typo like --browser=chrom.

Common situations: Assuming chromium is accepted; mixing unsupported engines into the matrix; copy-pasting a browser matrix from another tool.

Related errors


AI-assisted analysis of chenglou/pretext@ac49b09b7d (2026-08-12). Data as JSON: /api/errors/a86dcc60c95e64e7. Report an issue: GitHub.