{"record":{"id":"cd6b82f1394e9f90","repo":"evanw/esbuild","slug":"invalid-footer-file-type-type","errorCode":null,"errorMessage":"Invalid footer file type: ${type}","messagePattern":"Invalid footer file type: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/shared/common.ts","lineNumber":328,"sourceCode":"  if (assetNames) flags.push(`--asset-names=${assetNames}`)\n  if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, 'main field')}`)\n  if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, 'condition')}`)\n  if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, 'external')}`)\n  if (alias) {\n    for (let old in alias) {\n      if (old.indexOf('=') >= 0) throw new Error(`Invalid package name in alias: ${old}`)\n      flags.push(`--alias:${old}=${validateStringValue(alias[old], 'alias', old)}`)\n    }\n  }\n  if (banner) {\n    for (let type in banner) {\n      if (type.indexOf('=') >= 0) throw new Error(`Invalid banner file type: ${type}`)\n      flags.push(`--banner:${type}=${validateStringValue(banner[type], 'banner', type)}`)\n    }\n  }\n  if (footer) {\n    for (let type in footer) {\n      if (type.indexOf('=') >= 0) throw new Error(`Invalid footer file type: ${type}`)\n      flags.push(`--footer:${type}=${validateStringValue(footer[type], 'footer', type)}`)\n    }\n  }\n  if (inject) for (let path of inject) flags.push(`--inject:${validateStringValue(path, 'inject')}`)\n  if (loader) {\n    for (let ext in loader) {\n      if (ext.indexOf('=') >= 0) throw new Error(`Invalid loader extension: ${ext}`)\n      flags.push(`--loader:${ext}=${validateStringValue(loader[ext], 'loader', ext)}`)\n    }\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) {","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/evanw/esbuild/blob/f6058f8364fe7ab91ca57a83e02577ed74c9cae4/lib/shared/common.ts#L310-L346","documentation":"The `footer` option (build) mirrors `banner`: a map of file type to text, serialized as `--footer:TYPE=TEXT`. An '=' inside the TYPE breaks parsing, so esbuild rejects it at lib/shared/common.ts:328.","triggerScenarios":"Passing `footer: { 'css=x': '...' }` or any footer key containing '='.","commonSituations":"Typo or generated key; using the wrong file-type identifier.","solutions":["Use a valid file type key without '=' (commonly 'js' or 'css').","Strip '=' from generated keys."],"exampleFix":"// before\nawait build({ entryPoints: ['app.ts'], footer: { 'js=x': '/* trailer */' } })\n\n// after\nawait build({ entryPoints: ['app.ts'], footer: { js: '/* trailer */' } })","handlingStrategy":"validation","validationCode":"const VALID_FOOTER_TYPES = new Set(['js', 'css'])\nfunction assertFooterKeys(map) {\n  for (const k of Object.keys(map ?? {})) {\n    if (!VALID_FOOTER_TYPES.has(k)) throw new Error(`footer key must be 'js' or 'css', got ${k}`)\n  }\n}\nassertFooterKeys(options.footer)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict footer keys to 'js' or 'css'.","Don't embed '=' or filenames in footer keys.","Keep footer text in the value position."],"tags":["config","validation","footer"],"backgroundTag":null,"analyzedSha":"f6058f8364fe7ab91ca57a83e02577ed74c9cae4","analyzedAt":"2026-08-09T18:37:22.223Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}