Debug Edge Functions locally
Debug your Edge Functions locally using Chrome DevTools for breakpoint debugging and code inspection.
Debug your Edge Functions on your machine in Chrome DevTools, with breakpoints and code inspection.
Overview
Supabase CLI v1.171.0 or later supports debugging Edge Functions via the v8 inspector protocol, allowing for debugging via Chrome DevTools and other Chromium-based browsers.
Inspect with Chrome Developer Tools
To debug a function, serve it in inspect mode, connect DevTools, then send a request. This takes two phases.
1. Serve your function and connect DevTools
To serve your functions in inspect mode and connect Chrome DevTools to them:
- Serve your functions in inspect mode. This sets a breakpoint at the first line to pause script execution before any code runs.
supabase functions serve --inspect-mode brk
- In your Chrome browser, go to
chrome://inspect. - Click Configure... to the right of the Discover network targets checkbox.
- In the Target discovery settings dialog box that opens, enter
127.0.0.1:8083in the blank space and click Done to close the dialog. - Click Open dedicated DevTools for Node to complete the preparation for debugging. The opened DevTools window now listens to any incoming requests to edge-runtime.
Chrome DevTools is now configured and ready to debug your functions.
2. Send a request and debug it
To pause on a request and inspect your function's execution:
- Send a request to your function running locally, e.g. via curl or Postman. The DevTools window now pauses script execution at the first line.
- In the Sources tab, go to
file://>home/deno/functions/<your-function-name>/index.ts. - Use the DevTools to set breakpoints and inspect the execution of your Edge Function.

Next steps
To keep building and testing your functions locally, see these pages:
- Development environment: set up your editor and project structure for Edge Functions.
- Testing your Edge Functions: write unit tests with Deno Test.
- Edge Functions logging: read the logs for your functions.