Revali provides built-in debugging support that allows you to debug your server-side code using your favorite IDE. You can set breakpoints, inspect variables, step through code, and analyze the execution flow in real-time.
How Debugging Works#
When you start the Revali development server, it automatically launches a Dart VM service that your IDE can connect to. This enables full debugging capabilities for your server-side code.
Connecting to the VM Service#
VS Code (Recommended)#
-
Open Command Palette: Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) Search for Debug Command: Type
Dart: Attach to Process-
Get the VM Service URL: Look for this line in your terminal:
The Dart VM service is listening on http://127.0.0.1:8080/ykhykCh6zyY=/ -
Connect: Copy the URL (e.g.,
http://127.0.0.1:8080/ykhykCh6zyY=/) and paste it into the input box Start Debugging: Press
Enterto connect
IntelliJ IDEA / Android Studio#
- Open Run Configuration: Go to
Run→Edit Configurations -
Add New Configuration: Click
+and selectDart Remote Debug -
Configure Connection:
- Set the VM service URL from your terminal
- Choose your project directory
- Start Debugging: Run the configuration
Debugging Features#
Once connected, you can:
- Set Breakpoints: Click in the gutter next to line numbers
- Step Through Code: Use F10 (step over), F11 (step into), Shift+F11 (step out)
- Inspect Variables: Hover over variables or use the Variables panel
- Evaluate Expressions: Use the Debug Console to run code snippets
- Call Stack: See the execution path that led to the current point
Troubleshooting#
Connection Issues#
- Port Conflicts: Ensure port 8080 isn't used by other services
- Firewall: Check if your firewall is blocking the debug port
- VM Service URL: Verify the URL format matches exactly
Debugging Not Working#
- IDE Extensions: Ensure Dart/Flutter extensions are installed and updated
- Project Structure: Make sure you're debugging the correct project
- Server Running: Verify the Revali server is actually running
Next Steps#
- Hot Reload: Learn about automatic code reloading
- Error Handling: Learn about exception handling