{"id":"b590475beccf915e","repo":"evanw/esbuild","slug":"invalid-what-value","errorCode":null,"errorMessage":"Invalid ${what}: ${value}","messagePattern":"Invalid (.+?): (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/shared/common.ts","lineNumber":16,"sourceCode":"import type * as types from \"./types\"\nimport * as protocol from \"./stdio_protocol\"\nimport { JSON_parse } from \"./uint8array_json_parser\"\n\ndeclare const ESBUILD_VERSION: string\n\nconst quote: (x: string) => string = JSON.stringify\n\nconst buildLogLevelDefault = 'warning'\nconst transformLogLevelDefault = 'silent'\n\nfunction validateAndJoinStringArray(values: string[], what: string): string {\n  const toJoin: string[] = []\n  for (const value of values) {\n    validateStringValue(value, what)\n    if (value.indexOf(',') >= 0) throw new Error(`Invalid ${what}: ${value}`)\n    toJoin.push(value)\n  }\n  return toJoin.join(',')\n}\n\nlet canBeAnything = () => null\n\nlet mustBeBoolean = (value: boolean | undefined): string | null =>\n  typeof value === 'boolean' ? null : 'a boolean'\n\nlet mustBeString = (value: string | undefined): string | null =>\n  typeof value === 'string' ? null : 'a string'\n\nlet mustBeRegExp = (value: RegExp | undefined): string | null =>\n  value instanceof RegExp ? null : 'a RegExp object'\n\nlet mustBeInteger = (value: number | undefined): string | null =>\n  typeof value === 'number' && value === (value | 0) ? null : 'an integer'","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/evanw/esbuild/blob/6ff1d8b0d8c134e867a397eef39702a223ebef9e/lib/shared/common.ts#L1-L34","documentation":"Error \"Invalid ${what}: ${value}\" thrown in evanw/esbuild.","triggerScenarios":"Thrown at lib/shared/common.ts:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid value for the option: check that the value matches the expected type or format","Consult the esbuild API documentation for the allowed values of this option"],"exampleFix":"// e.g. charset must be \"ascii\" or \"utf8\"\nesbuild.buildSync({ charset: 'utf8', ... });","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"6ff1d8b0d8c134e867a397eef39702a223ebef9e","analyzedAt":"2026-08-03T19:42:38.433Z","schemaVersion":2}