Skip to content

Reference designators empty on custom inline footprints #227

@dwiel

Description

@dwiel

Summary

Components using a custom inline {...} prop export to .kicad_pcb with an empty
Reference property. The TSX name attribute is not propagated to (property "Reference" ...). Built-in string
footprints (footprint="soic8") export correctly — the issue is specific to custom inline footprints, which is
the pattern most LCSC imports use.

Minimal repro

// imports/AP2112K_3_3TRG1.tsx
export const AP2112K_3_3TRG1 = (props: { name: string, pcbX: number, pcbY: number }) => (
  <chip name={props.name} pcbX={props.pcbX} pcbY={props.pcbY}
    footprint={
      <footprint>
        <smtpad pcbX={-0.95} pcbY={-1.30} portHints={["1"]} /* ... */ />
        {/* more pads */}
      </footprint>
    }
    supplierPartNumbers={{ jlcpcb: ["C51118"] }} />
)

// test.tsx
import { AP2112K_3_3TRG1 } from "./imports/AP2112K_3_3TRG1"
export default () => (
  <board width="50mm" height="50mm">
    <AP2112K_3_3TRG1 name="U_TEST" pcbX={0} pcbY={0} />
  </board>
)

npx tsci export test.tsx -f kicad_pcb -o test.kicad_pcb
grep -A1 'property "Reference"' test.kicad_pcb

Expected

(property "Reference" "U_TEST" ...)

Actual

(property "Reference" "" ...)

Notes

  • Pad positions, nets, and UUIDs are emitted correctly — only the Reference field is blank.
  • The component name is available in the circuit-json (pad net names embed it, e.g. ".Rfb1 > .pin2 to .U1 >
    .INA_N"), so the name is flowing into circuit-json; it just doesn't reach the Reference property during KiCad
    emission.
  • Downstream impact: silkscreen labels blank, assembly BOM↔placement matching broken, DRC messages can't
    identify components.
  • Versions observed: tscircuit 0.0.1637, @tscircuit/core 0.0.1167, circuit-json-to-kicad 0.0.103

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions