{"record":{"id":"3a79991bb1b0f46f","repo":"apache/beam","slug":"unknown-runner-options-runner","errorCode":null,"errorMessage":"Unknown runner: ${options.runner}","messagePattern":"Unknown runner: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/runners/runner.ts","lineNumber":79,"sourceCode":" * a direct runner.  If no runner option is specified, the \"default\" runner\n * is used, which runs what pipelines it can on the direct runner, and\n * otherwise falls back to the universal runner (e.g. if cross-language\n * transforms, non-trivial windowing, etc. are used).\n */\nexport function createRunner(options: any = {}): Runner {\n  let runnerConstructor: (any) => Runner;\n  if (options.runner === undefined || options.runner === \"default\") {\n    runnerConstructor = defaultRunner;\n  } else if (options.runner === \"direct\") {\n    runnerConstructor = require(\"./direct_runner\").directRunner;\n  } else if (options.runner === \"universal\") {\n    runnerConstructor = require(\"./universal\").universalRunner;\n  } else if (options.runner === \"flink\") {\n    runnerConstructor = require(\"./flink\").flinkRunner;\n  } else if (options.runner === \"dataflow\") {\n    runnerConstructor = require(\"./dataflow\").dataflowRunner;\n  } else {\n    throw new Error(\"Unknown runner: \" + options.runner);\n  }\n  return runnerConstructor(options);\n}\n\n/**\n * A Runner is the object that takes a pipeline definition and actually\n * executes, e.g. locally or on a distributed system, by invoking its\n * `run` or `runAsync` method.\n *\n * Runners are generally created using the `createRunner` method in this\n * same module.\n */\nexport abstract class Runner {\n  /**\n   * Runs the transform.\n   *\n   * Resolves to an instance of PipelineResult when the pipeline completes.\n   * Use runAsync() to execute the pipeline in the background.","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/runners/runner.ts#L61-L97","documentation":"createRunner maps the options.runner name to a constructor via a fixed if/else chain (direct, universal, flink, dataflow). Any other runner string falls to the else branch and throws 'Unknown runner: <name>'. It is a configuration validation error for an unrecognized runner identifier.","triggerScenarios":"Passing options.runner set to a misspelled or unsupported value (e.g. 'spark', 'Direct', 'FlinkRunner') to createRunner or main().","commonSituations":"Typos in pipeline options files, copying runner names from other Beam SDKs (Python's 'SparkRunner'), or using a runner that the TypeScript SDK simply does not ship.","solutions":["Set options.runner to one of the supported values: 'direct', 'universal', 'flink', or 'dataflow'.","Check for case/typo errors in the runner string.","Register your own runner by calling its constructor directly instead of going through createRunner."],"exampleFix":"// before\nconst runner = await createRunner({ runner: \"spark\" });\n// after\nconst runner = await createRunner({ runner: \"flink\" });","handlingStrategy":"validation","validationCode":"const SUPPORTED = [\"direct\", \"universal\", \"flink\", \"dataflow\"];\nif (!SUPPORTED.includes(options.runner)) throw new Error(`runner must be one of ${SUPPORTED.join(\", \")}`);","typeGuard":"function isKnownRunner(r: string): r is \"direct\" | \"universal\" | \"flink\" | \"dataflow\" {\n  return [\"direct\", \"universal\", \"flink\", \"dataflow\"].includes(r);\n}","tryCatchPattern":"try {\n  const runner = await createRunner(options);\n} catch (e) {\n  if (e.message.startsWith(\"Unknown runner:\")) {\n    console.error(`Invalid runner '${options.runner}'. Use direct|universal|flink|dataflow.`);\n  } else throw e;\n}","preventionTips":["Validate runner names against the supported list before invoking createRunner","Keep runner strings lowercase and consistent with the SDK's if/else mapping","Enumerate valid runners in a config schema or union type"],"tags":["runner","configuration","invalid-value"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}