Chase a bug
Open nvim, the Debugger and the dev server. Set a breakpoint, trigger the request, read the variables. The code, the paused frame and the server's output stay on screen together.
The board
nvim A Terminal running nvim on the file you suspect, with your own config.
Debugger Opened from nvim, beside it. It runs the dev server under the debugger: breakpoints, the call stack, the variables and the server's output.
Processes The dev server. The Debugger takes it while it debugs it, and hands it back when it stops.
Step by step
- 01 Open the suspect file Runnvim
nvim +42 src/refund.tsin the Terminal column. Line 42 returns the refund already made for the key, when there is one. - 02 Open the Debugger From nvim,debugger
:!orven debug open --proc api. A Debugger opens beside it and runs the api from Processes under the debugger. - 03 Set a breakpointdebugger
:!orven debug open --show src/refund.ts:42shows the line in the Debugger. Click its gutter. - 04 Trigger the request Replay the webhook from nvim withnvim
:!pnpm replay 812: Stripe's warning, delivered twice, 37 ms apart. The first delivery stops on line 42. - 05 Read the frame Click refund in the call stack:debugger
prioris null. Continue, and the second delivery stops on the same line withpriorstill null: the first hasn't saved its refund yet. Continue again, and both go to Stripe. - 06 Hand it back Press Stop. The api runs in Processes again.processes