{"record":{"id":"822d757f6517c733","repo":"evanw/esbuild","slug":"missing-property-in-for-entry-point-at-index-i","errorCode":null,"errorMessage":"Missing property \"in\" for entry point at index ${i}","messagePattern":"Missing property \"in\" for entry point at index (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/shared/common.ts","lineNumber":355,"sourceCode":"    }\n  }\n  if (outExtension) {\n    for (let ext in outExtension) {\n      if (ext.indexOf('=') >= 0) throw new Error(`Invalid out extension: ${ext}`)\n      flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], 'out extension', ext)}`)\n    }\n  }\n\n  if (entryPoints) {\n    if (Array.isArray(entryPoints)) {\n      for (let i = 0, n = entryPoints.length; i < n; i++) {\n        let entryPoint = entryPoints[i]\n        if (typeof entryPoint === 'object' && entryPoint !== null) {\n          let entryPointKeys: OptionKeys = Object.create(null)\n          let input = getFlag(entryPoint, entryPointKeys, 'in', mustBeString)\n          let output = getFlag(entryPoint, entryPointKeys, 'out', mustBeString)\n          checkForInvalidFlags(entryPoint, entryPointKeys, 'in entry point at index ' + i)\n          if (input === undefined) throw new Error('Missing property \"in\" for entry point at index ' + i)\n          if (output === undefined) throw new Error('Missing property \"out\" for entry point at index ' + i)\n          entries.push([output, input])\n        } else {\n          entries.push(['', validateStringValue(entryPoint, 'entry point at index ' + i)])\n        }\n      }\n    } else {\n      for (let key in entryPoints) {\n        entries.push([key, validateStringValue(entryPoints[key], 'entry point', key)])\n      }\n    }\n  }\n\n  if (stdin) {\n    let stdinKeys: OptionKeys = Object.create(null)\n    let contents = getFlag(stdin, stdinKeys, 'contents', mustBeStringOrUint8Array)\n    let resolveDir = getFlag(stdin, stdinKeys, 'resolveDir', mustBeString)\n    let sourcefile = getFlag(stdin, stdinKeys, 'sourcefile', mustBeString)","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/evanw/esbuild/blob/f6058f8364fe7ab91ca57a83e02577ed74c9cae4/lib/shared/common.ts#L337-L373","documentation":"When `entryPoints` is an array of objects (the input/output mapping form), each object must contain both `in` (the input path) and `out` (the output path). At lib/shared/common.ts:355 esbuild throws if `in` is missing, naming the offending index. The `out` property is checked similarly right after.","triggerScenarios":"Passing `entryPoints: [{ out: 'dist/a.js' }]` (forgot `in`), or programmatically building entry objects and skipping the `in` field for some index.","commonSituations":"Generating entry-point objects from a glob and forgetting to populate `in`; renaming fields during a refactor; misreading docs and providing only `out`.","solutions":["Add the `in` property with the source path to the entry-point object at the reported index.","If you don't need output renaming, use the simpler string form: entryPoints: ['src/a.ts'].","When generating objects, validate each has both `in` and `out` before calling build()."],"exampleFix":"// before\nawait build({ entryPoints: [{ out: 'dist/app.js' }], bundle: true })\n\n// after\nawait build({ entryPoints: [{ in: 'src/app.ts', out: 'dist/app.js' }], bundle: true })","handlingStrategy":"validation","validationCode":"function normalizeEntryPoints(entryPoints) {\n  if (!Array.isArray(entryPoints)) return entryPoints\n  entryPoints.forEach((ep, i) => {\n    if (ep && typeof ep === 'object') {\n      if (typeof ep.in !== 'string') throw new Error(`entryPoints[${i}] is missing string property \"in\"`)\n      if (typeof ep.out !== 'string') throw new Error(`entryPoints[${i}] is missing string property \"out\"`)\n    }\n  })\n  return entryPoints\n}\noptions.entryPoints = normalizeEntryPoints(options.entryPoints)","typeGuard":"function isEntryPointObject(v): v is { in: string; out: string } {\n  return !!v && typeof v === 'object'\n    && typeof v.in === 'string' && typeof v.out === 'string'\n}","tryCatchPattern":null,"preventionTips":["When generating entry objects from a glob, always populate both `in` and `out`.","If you don't need output renaming, prefer the simpler string form entryPoints: ['src/a.ts'].","Validate generated entry objects before passing them to build()."],"tags":["config","validation","entry-points"],"backgroundTag":null,"analyzedSha":"f6058f8364fe7ab91ca57a83e02577ed74c9cae4","analyzedAt":"2026-08-09T18:37:22.223Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}