Check the result
After each edit, run the checks from your project folder:
npx pcbjs checkThis compiles the board, routes automatic legs, checks the physical and electrical design, and type-checks the configured entries. The supplied Blinky is expected to have zero DRC errors, warnings and unconnected nets, and zero ERC errors and warnings.
// Blinky: three LED channels switched by one transistor on a 30 x 20 mm two-layer board, in three files: // blinky.sch.tsx has the nets, parts and schematic picture, blinky.sourcing.ts the part numbers, and this file the layout. // Frame: millimetres, origin at the top-left corner of the outline, x right, y down (SVG). // C1 sits on the back because CH2's led track runs over its spot on the front, and its chip footprint prints no ref. // VCC runs from J1.2 to a bus at x = 9 where each channel row starts, then to a via and C1 on the back. import PCB, { route, pour, via } from '@pcbjs/core' import { Brand, rect, roundedRect } from '@pcbjs/lib' import * as sch from './blinky.sch' import './blinky.sourcing' import { layout as LedChannelRow } from './lib/led-channel' const W = 30, H = 20 export default ( <PCB name="Blinky" rev="0.1.0" schematic={sch} rules={{ clearance: 0.2, minTrackWidth: 0.2, requireSourcing: true }} autoroute={{ bend: '45', viaCost: 4 }}> <path layer="Edge.Cuts" d={roundedRect(W, H, 2)} /> {/* J1, Q1 and C1 by hand, each channel by its circuit's row layout */} <J1 at="3 8" /> <Q1 at="26 10" /> <LedChannelRow g={CH1} at="16 5" label="LED1" /> <LedChannelRow g={CH2} at="16 10" label="LED2" /> <LedChannelRow g={CH3} at="16 15" label="LED3" /> <C1 at="15 10" side="B" /> <text layer="B.SilkS" at="15 8.3" size={0.8}> C1 </text> {/* tracks as path strings, a via, and a chain whose last hop .X() leaves to the autorouter */} {route('3 10').net(VCC).width(0.3).H(9)} {route('9 5').net(VCC).width(0.3).V(15)} {route('9 11.6').net(VCC).width(0.3).H(15.8)} {via(VCC, '15.8 11.6')} {route('15.8 11.6').net(VCC).layer('B.Cu').width(0.3).V(10)} {route('22.2 5').net(SW).width(0.3).V(16.5).H(27).V(10)} {route(J1[3], Q1[1]).width(0.25).V(14).L(5, 16).via('B.Cu').X('24 16').V(7.5).via('F.Cu')} {/* GND: a pour over the back, Q1.2 autorouted into it */} {route(Q1[2], '25 12.5 B.Cu').width(0.3)} {pour(GND, 'B.Cu', rect(W, H))} <text layer="F.SilkS" at="3 4.3" size={0.8}> GND </text> <text layer="F.SilkS" at="15 18.5" size={1}> Blinky · pcbjs </text> <Brand at="15 4" height={5} layer="B.SilkS" /> </PCB> )
No finding is focused.
Read the three kinds of feedback
| Check | What it examines | An example to investigate |
|---|---|---|
| DRC | Copper, geometry and manufacturing rules | A clearance finding names objects that are too close; unconnected means a net's copper is not fully joined |
| ERC | Electrical declarations and other design requirements | unconnected-pin identifies an omitted pin connection; unsourced-part identifies missing part numbers when sourcing is required |
| TypeScript | The design program and typed APIs | An unknown pin handle, a misspelled property or an incompatible argument |
A clean schematic connection does not guarantee connected copper. Conversely, copper can meet its spacing rules while a pin has the wrong intended net. Read both the declarations and the compiled board.
Investigate a finding
A finding includes its rule, affected references and a message explaining the problem. It can also include the layer, position and source location. Start with that location and inspect the named objects.
For Blinky, these commands connect the header's logical role with its actual geometry:
npx pcbjs inspect J1
npx pcbjs inspect J1/3
npx pcbjs inspect SIGOpen the dedicated DRC/ERC viewer to read finding details, expand the list or move between errors with previous/next. Selecting a finding focuses its affected objects across applicable views; the drawing itself shows only the finding type on hover. The Blinky viewer shows the supplied example; npm run dev shows your local edits. In VS Code, the pcbjs extension can show the viewer beside the source, as described in Editor setup.
Fix the cause, save and run check again. If routing fails, inspect the blocked corridor before moving several parts at once. An early route-failed finding can explain later unconnected-net findings.
Keep the loop short
- Make one small edit to the schematic or board.
- Look at the affected objects in 2D or Schematic; use 3D for the board and part arrangement.
- Run
checkand read any changed findings. - Keep the result or restore the previous version before the next experiment.
npx pcbjs check --watch repeats the check on save. A warning does not make the command fail, but still needs review. A DRC or ERC error, an unconnected net, a compile error or a type error causes a failing exit code.
Build when ready
Once the intended design is checked and visually reviewed:
npm run buildThe build writes the fabrication set under .pcbjs/fab/Blinky/ and the static viewer site under .pcbjs/dist/. It runs fabrication checks but does not replace check's TypeScript validation. Review README-fab.txt, the fabrication files and the part choices before ordering.
You have followed one board from connections to physical output. Continue with the Advanced guide when you need reusable circuits, constraints or fabrication workflows. Use the Check reference and Findings reference to investigate specific results.