deepseek-ai/deepseek-harness · error · TypeGraphRenderError
mapped type parameter ${node.parameter.name} has no constrai
Error message
mapped type parameter ${node.parameter.name} has no constraint What it means
Error "mapped type parameter ${node.parameter.name} has no constraint" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/typert/generator/src/renderer.ts:133
}
return `${element.rest ? '...' : ''}${type}${element.optional ? '?' : ''}`
})
return `[${elements.join(', ')}]`
}
case 'object': return this.renderObject(node.members, references)
case 'function': return `${this.renderSignatureHead(node.signature, references)} => ${this.renderType(node.signature.returns, references)}`
case 'constructor': return `${node.abstract ? 'abstract ' : ''}new ${this.renderSignatureHead(node.signature, references)} => ${this.renderType(node.signature.returns, references)}`
case 'indexed-access': return `${this.renderType(node.object, references)}[${this.renderType(node.index, references)}]`
case 'operator': return `${node.operator} ${this.renderType(node.type, references)}`
case 'conditional': {
return `${this.renderType(node.check, references)} extends ${this.renderType(node.extends, references)} ? ${this.renderType(node.whenTrue, references)} : ${this.renderType(node.whenFalse, references)}`
}
case 'infer': return `infer ${this.renderTypeParameter(node.parameter, false, references)}`
case 'mapped': {
const readonly = node.readonly === 'preserve' ? '' : node.readonly === 'remove' ? '-readonly ' : 'readonly '
const optional = node.optional === 'preserve' ? '' : node.optional === 'remove' ? '-?' : '?'
if (node.parameter.constraint === undefined) {
throw new TypeGraphRenderError(`mapped type parameter ${node.parameter.name} has no constraint`)
}
const parameter = `${node.parameter.name} in ${this.renderType(node.parameter.constraint, references)}`
const nameType = node.nameType === undefined ? '' : ` as ${this.renderType(node.nameType, references)}`
const value = node.value === undefined ? 'unknown' : this.renderType(node.value, references)
return `{ ${readonly}[${parameter}${nameType}]${optional}: ${value} }`
}
case 'template-literal': {
const spans = node.spans.map(span => `\${${this.renderType(span.type, references)}}${escapeTemplate(span.text)}`).join('')
return `\`${escapeTemplate(node.head)}${spans}\``
}
case 'type-query': {
const argumentsText = node.arguments.length === 0
? ''
: `<${node.arguments.map(argument => this.renderType(argument, references)).join(', ')}>`
return `typeof ${node.expression}${argumentsText}`
}
case 'import-type': {
const attributes = node.attributes === undefined ? '' : `, ${node.attributes}`View on GitHub (pinned to b150a551b8)
Solutions
- Add a constraint to the mapped type parameter, or handle unconstrained parameters in the renderer input.
When it happens
Trigger: Thrown at packages/typert/generator/src/renderer.ts:133 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/aa818104e53fa393.
Report an issue: GitHub.