`<mosfet footprint="sot23">` puts the gate on the drain pad of real SOT-23 MOSFETs, and has no `pinLabels` to fix it
Maintainers usually reply within 1 day
@aswadi is already working on this.
Since Nov 15, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- tooling
Research direction
Start from the <transistor> change in #4775, since that is the precedent: find how pinLabels is declared on the transistor props in @tscircuit/props and applied in core, then look at MosfetProps and the mosfet implementation to see how the sot23 footprint's pad-to-port mapping is produced. Compare against the circuit.json pad positions in the issue and add a focused test asserting that Q1.gate lands on pad 1 for footprint="sot23". Done means either a working pinLabels prop or a corrected G-S-D default, with that test passing.
Written by the indexing model from the issue text.
Description
<mosfet footprint="sot23"> puts the gate on the pad where real SOT-23 MOSFETs have their drain, and unlike <transistor> (fixed in #4775) there is no pinLabels to change it.
<mosfet name="Q1" channelType="n" mosfetMode="enhancement" footprint="sot23" />
What it builds (from circuit.json, pad positions relative to the part):
| Pad | Position | <mosfet> port |
|---|---|---|
| 1 | (-1.14, 0.95) | drain |
| 2 | (-1.14, -0.95) | source |
| 3 | (1.14, 0) — the lone pad | gate |
What the parts' datasheets say (SOT-23, all N-channel):
| Part | Pin 1 | Pin 2 | Pin 3 (lone pad) |
|---|---|---|---|
| AO3400A (Alpha & Omega, rev 3.1, p.1) | Gate | Source | Drain |
| BSS138 (onsemi, rev 7, p.1 marking diagram) | Gate | Source | Drain |
JLCPCB's own AO3400A footprint (tsci import C347475) |
G | S | D |
So with the built-in component, the net you connect to Q1.gate lands on the real part's drain, and Q1.drain lands on its gate. The board builds with no warnings and the error only shows up after assembly.
No way around it inside <mosfet>: MosfetProps has no pinLabels, and passing one anyway is silently ignored (the gate stays on pad 3, no error):
<mosfet name="Q2" channelType="n" mosfetMode="enhancement" footprint="sot23"
pinLabels={{ pin1: "gate", pin2: "source", pin3: "drain" }} />
For comparison, <transistor> got exactly this in #4775 and it works: pinLabels={{ pin1: "base", pin2: "emitter", pin3: "collector" }} moves base to pad 1 as expected.
Suggested fix: either give <mosfet> the same pinLabels support as <transistor>, or (better for new users) make the default order G-S-D, which matches the common SOT-23 MOSFETs (AO3400/AO3401, BSS138, 2N7002, SI2302 and similar). The current workaround is a <chip> with pinLabels, which loses the MOSFET symbol.
Found while building a 555 PWM dimmer; I used the imported JLCPCB part instead.
Versions: tscircuit 0.0.3188, @tscircuit/core 0.0.2380, @tscircuit/props 0.0.732
- Dominant language
- TypeScript
- Stars
- 61
- Forks
- 256
- Avg merge
- 20h 21m
- Merged PRs (30d)
- 289
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tscircuit/core
-
Standalone `import("@tscircuit/core")` fails with `ERR_MODULE_NOT_FOUND` due to `devDependencies`-only imports in `dist/`Possibly taken @Andresdev14 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tscircuit/core#5508 · 1 comment ·
Maintainers usually reply within 1 day
-
Default solder paste aperture is 0.7x the pad (49% of its area)Possibly taken @zainrizvi0611-cmd claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
tscircuit/core#4800 · 1 comment ·
Maintainers usually reply within 1 day
-
SCHEMATIC_COMPONENT_OUTLINE_COLOR "rgba(132, 0, 0)" is not portable SVG color; strict SVG renderers reject schematic outputPossibly taken @zainrizvi0611-cmd claimed this 17 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Scientific notation is truncated in simulation graph scale and offset settingsPossibly taken @Crodify claimed this 9 days ago. Openno-issue-activity
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tscircuit/core#3732 · 1 comment ·
Maintainers usually reply within 1 day
-
SchematicRect drops fillColor from circuit JSON and renders filled rectangles with the stroke colorPossibly taken @cocvn157 claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tintinweb/pi-subagents#459 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
danielmiessler/LifeOS#2830 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freshframework/fresh#3920 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: client enhancement priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
opensro-dev/opensro#3681 ·
Maintainers usually reply within 1 day