PAC-E001 · syntax-error

PAC file does not parse

critical · Errors and robustness

The file is not valid JavaScript. No engine can run it; every browser falls back to its no-PAC behaviour, which in practice is DIRECT.

Why it matters

A PAC file is a JavaScript program. If it does not parse, no engine ever gets to call FindProxyForURL, and the client behaves as if no proxy were configured. In Chromium the failed script is logged and connections go direct unless the ProxyPacMandatory policy is set. For an enterprise that relies on the proxy for inspection and logging this is the worst possible outcome: every request bypasses the proxy and nobody is told.

Typical causes: a missing brace or quote, a copy-paste accident, smart quotes from a word processor (see PAC-E014), ES2015 syntax on an ES5 engine (see PAC-K001, reported separately because it parses in modern browsers).

How to fix

Fix the reported syntax error; run the file through a JavaScript parser (ES5 mode) before deploying.

Examples

Bad

function FindProxyForURL(url, host) {
  if (isPlainHostName(host)) {
    return "DIRECT";

  return "PROXY proxy.corp.example:8080";
}
Open bad example in checker

Good

function FindProxyForURL(url, host) {
  if (isPlainHostName(host)) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open good example in checker

The bad example is missing the closing brace of the if block.

Engine behaviour

EngineBehaviourSource
chromiumScript load fails; requests go DIRECT unless the ProxyPacMandatory policy is set.doc, verified 2026-10-04 · ref

Source: code = read in the engine's source, doc = vendor documentation, lab = observed in a lab run, expert = practitioner knowledge, not yet verified.

Related rules

References