All workflows
Workflows/Debugging/01

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

  1. 01
    Open the suspect file Run nvim +42 src/refund.ts in the Terminal column. Line 42 returns the refund already made for the key, when there is one.
    nvim
  2. 02
    Open the Debugger From nvim, :!orven debug open --proc api. A Debugger opens beside it and runs the api from Processes under the debugger.
    debugger
  3. 03
    Set a breakpoint :!orven debug open --show src/refund.ts:42 shows the line in the Debugger. Click its gutter.
    debugger
  4. 04
    Trigger the request Replay the webhook from nvim with :!pnpm replay 812: Stripe's warning, delivered twice, 37 ms apart. The first delivery stops on line 42.
    nvim
  5. 05
    Read the frame Click refund in the call stack: prior is null. Continue, and the second delivery stops on the same line with prior still null: the first hasn't saved its refund yet. Continue again, and both go to Stripe.
    debugger
  6. 06
    Hand it back Press Stop. The api runs in Processes again.
    processes

Close the other windows.

Get ORVEN