{"record":{"id":"05f2466e00e6220e","repo":"run-llama/liteparse","slug":"parsetimeoutms-requires-poolsize","errorCode":null,"errorMessage":"parseTimeoutMs requires poolSize","messagePattern":"parseTimeoutMs requires poolSize","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/node/src/lib.ts","lineNumber":678,"sourceCode":"      quiet: userConfig.quiet,\n      numWorkers: userConfig.numWorkers,\n      ocrFailureFatal: userConfig.ocrFailureFatal,\n      ocrHedgeDelaysMs: userConfig.ocrHedgeDelaysMs,\n      emitWordBoxes: userConfig.emitWordBoxes,\n      extractTextMetadata: userConfig.extractTextMetadata,\n      cropBox: userConfig.cropBox,\n      skipDiagonalText: userConfig.skipDiagonalText,\n      includeComplexity: userConfig.includeComplexity,\n      extractVectorGraphics: userConfig.extractVectorGraphics,\n    };\n\n    this._native = new native.LiteParse(nativeConfig);\n\n    if (\n      userConfig.parseTimeoutMs !== undefined &&\n      userConfig.poolSize === undefined\n    ) {\n      throw new Error(\n        \"parseTimeoutMs requires poolSize\"\n      );\n    }\n    if (userConfig.poolSize !== undefined) {\n      this._pool = new WorkerPool(\n        nativeConfig as unknown as Record<string, unknown>,\n        userConfig.poolSize,\n        userConfig.parseTimeoutMs,\n      );\n    }\n\n    // Read back the resolved config from the native side\n    const resolved = this._native.config;\n    this._config = {\n      ocrLanguage: resolved.ocrLanguage ?? \"eng\",\n      ocrEnabled: resolved.ocrEnabled ?? true,\n      ocrServerUrl: resolved.ocrServerUrl ?? undefined,\n      ocrServerHeaders: resolved.ocrServerHeaders ?? undefined,","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/run-llama/liteparse/blob/22d2dd8cd7f7b9320102b57ddaf0e663ff7d15a8/packages/node/src/lib.ts#L660-L696","documentation":"The Node LiteParse constructor throws when `parseTimeoutMs` is set in the user config but `poolSize` is not. Timeout-based parsing is only implemented via the WorkerPool path, so specifying a timeout without enabling the pool is a configuration contradiction the library refuses rather than silently ignoring the timeout.","triggerScenarios":"`new LiteParse({ parseTimeoutMs: 5000 })` without `poolSize`; adding `parseTimeoutMs` to an existing config that never enabled pooling; a config file/template where poolSize was removed but parseTimeoutMs remained.","commonSituations":"Developers adding a timeout to fix hung parses without realizing it requires the worker-pool mode; environment-driven config where POOL_SIZE is unset but PARSE_TIMEOUT_MS is set.","solutions":["Add `poolSize` to the config alongside `parseTimeoutMs` (e.g. `{ poolSize: 2, parseTimeoutMs: 5000 }`).","Remove `parseTimeoutMs` if you do not need pool-based timeouts.","Validate that both options are set together in config-loading code before constructing LiteParse."],"exampleFix":"// before\nconst lp = new LiteParse({ parseTimeoutMs: 5000 });\n// after\nconst lp = new LiteParse({ poolSize: 2, parseTimeoutMs: 5000 });","handlingStrategy":"validation","validationCode":"function assertPoolTimeoutConfig(cfg) {\n  if (cfg.parseTimeoutMs !== undefined && cfg.poolSize === undefined) {\n    throw new Error('parseTimeoutMs requires poolSize');\n  }\n}\nassertPoolTimeoutConfig(userConfig); // call before new LiteParse(...)","typeGuard":null,"tryCatchPattern":"let lp;\ntry {\n  lp = new LiteParse(userConfig);\n} catch (e) {\n  if (e.message === 'parseTimeoutMs requires poolSize') {\n    lp = new LiteParse({ ...userConfig, poolSize: 2 });\n  } else throw e;\n}","preventionTips":["Treat parseTimeoutMs and poolSize as one coupled setting in your config layer.","Validate merged config (defaults + env + file) before constructing LiteParse.","Document in your team config schema that timeout implies poolSize."],"tags":["configuration","node","worker-pool"],"backgroundTag":"conflicting-config-options","analyzedSha":"22d2dd8cd7f7b9320102b57ddaf0e663ff7d15a8","analyzedAt":"2026-09-08T06:09:49.009Z","contentChangedAt":"2026-09-08T06:09:49.009Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}