tscircuit: source_failed_to_create_component_error

Diagnostic signature

source_failed_to_create_component_error

Emitted when tscircuit fails to instantiate or construct a source component or subcircuit element during circuit elaboration, typically due to conflicting, invalid, or malformed component properties.

What it means

In Circuit JSON specifications, source_failed_to_create_component_error represents an element-level error diagnostic produced when the compilation engine cannot successfully build a component instance from the declared source code. When component creation fails, tscircuit inserts a SourceFailedToCreateComponentError element into the Circuit JSON array to record the failure reason, component name, and location context while halting further rendering or routing for that invalid component.

Why it happens

This error occurs during source evaluation when a component is declared with invalid, missing, or contradictory attributes. For example, supplying mutually exclusive connection properties (such as specifying both 'net' and 'connection' on a netlabel element), declaring unrecognized pin mappings, or providing incompatible geometry/placement properties will fail internal constructor validation and generate this diagnostic.

Minimal reproduction

import React from 'react';

export const ProblematicCircuit = () => (
  <board width="20mm" height="20mm">
    {/* Supplying net and connection simultaneously causes component construction to fail */}
    <netlabel
      net="VCC"
      connection="net.VCC"
      anchor="left"
    />
  </board>
);

How to fix it

Remove conflicting or unsupported properties from the component declaration so that the parameters satisfy component constructor validation rules.

```typescript
import React from 'react';

export const CorrectedCircuit = () => (
  <board width="20mm" height="20mm">
    {/* Use either net or connection according to intended connectivity */}
    <netlabel
      net="VCC"
      anchor="left"
    />
  </board>
);
```

Step 1

Step 2

Step 3

Step 4

Upstream references

circuit-json [email protected] — SourceFailedToCreateComponentError — retrieved 2026-08-11

tscircuit circuit-json Source Components Declaration: SourceFailedToCreateComponentError