source_missing_property_error
Emitted by the tscircuit toolchain when a source component or subcircuit element definition is missing a required property necessary for compilation or downstream processing.
The source_missing_property_error diagnostic represents a structured error in the Circuit JSON source domain. It indicates that a declared source component lacks a required property named in the property_name field. Circuit JSON elements in the source domain capture the original design intent before schematic and PCB layout generation; if an indispensable parameter is omitted, the compiler creates a source_missing_property_error element referencing the source_component_id and property_name.
This error occurs during Circuit JSON schema validation or AST translation when a component definition lacks a mandatory attribute. Typical causes include declaring a component without mandatory electrical parameters (such as resistance, capacitance, or pin mappings) or manually assembling Circuit JSON objects where required keys in the source component definition are omitted or undefined.
import { source_missing_property_error } from "circuit-json"
// Demonstrating parsing and validation of a source_missing_property_error diagnostic
const diagnosticElement = source_missing_property_error.parse({
type: "source_missing_property_error",
source_missing_property_error_id: "source_missing_property_error_0",
source_component_id: "source_component_resistor_1",
property_name: "resistance",
message: "Source component is missing required property 'resistance'"
})
console.log(JSON.stringify(diagnosticElement, null, 2))
Locate the component indicated by source_component_id and provide the attribute specified by property_name.
```typescript
import { source_simple_resistor } from "circuit-json"
// Corrected definition supplying the required resistance property
const validResistor = source_simple_resistor.parse({
type: "source_component",
ftype: "simple_resistor",
source_component_id: "source_component_resistor_1",
name: "R1",
resistance: "10kohm"
})
console.log("Valid resistor created:", validResistor.name)
```
circuit-json [email protected] — SourceMissingPropertyError — retrieved 2026-08-11
circuit-json SourceMissingPropertyError Source Declaration
circuit-json Schema Documentation - SourceMissingPropertyError