.claude/skills/tauri-debugging/SKILL.md
Helps users debug Tauri v2 applications across VS Code, RustRover, IntelliJ, and Neovim. Covers console debugging, WebView DevTools, Rust backtrace, CrabNebula DevTools integration, and IDE-specific launch configurations.
npx skillsauth add rdjakovic/todo2 debugging-tauri-appsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill covers debugging Tauri v2 applications including console debugging, WebView inspection, IDE configurations, and CrabNebula DevTools.
Use conditional compilation to exclude debug code from production builds:
// Only runs during `tauri dev`
#[cfg(dev)]
{
// Development-only code
}
// Runtime check
if cfg!(dev) {
// tauri dev code
} else {
// tauri build code
}
// Programmatic check
let is_dev: bool = tauri::is_dev();
// Debug builds and `tauri build --debug`
#[cfg(debug_assertions)]
{
// Debug-only code
}
Print messages to the terminal where tauri dev runs:
println!("Message from Rust: {}", msg);
dbg!(&variable); // Prints variable with file:line info
For detailed error information:
# Linux/macOS
RUST_BACKTRACE=1 tauri dev
# Windows PowerShell
$env:RUST_BACKTRACE=1
tauri dev
Ctrl + Shift + i (Linux/Windows)Cmd + Option + i (macOS)Platform-specific inspectors: WebKit (Linux), Safari (macOS), Edge DevTools (Windows).
tauri::Builder::default()
.setup(|app| {
#[cfg(debug_assertions)]
{
let window = app.get_webview_window("main").unwrap();
window.open_devtools();
// window.close_devtools();
}
Ok(())
})
Create a debug build for testing:
tauri build --debug
To permanently enable devtools in production, add to src-tauri/Cargo.toml:
[dependencies]
tauri = { version = "...", features = ["...", "devtools"] }
WARNING: Using the devtools feature enables private macOS APIs that prevent App Store acceptance.
| Extension | Platform | Purpose | |-----------|----------|---------| | vscode-lldb | All | LLDB debugger | | C/C++ | Windows | Visual Studio debugger |
Create .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Tauri Development Debug",
"cargo": {
"args": [
"build",
"--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"
]
},
"preLaunchTask": "ui:dev"
},
{
"type": "lldb",
"request": "launch",
"name": "Tauri Production Debug",
"cargo": {
"args": [
"build",
"--release",
"--manifest-path=./src-tauri/Cargo.toml"
]
},
"preLaunchTask": "ui:build"
}
]
}
For faster Windows debugging with better enum support:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch App Debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/src-tauri/target/debug/your-app-name.exe",
"cwd": "${workspaceRoot}",
"preLaunchTask": "dev"
}
]
}
Create .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "ui:dev",
"type": "shell",
"isBackground": true,
"command": "npm",
"args": ["run", "dev"]
},
{
"label": "ui:build",
"type": "shell",
"command": "npm",
"args": ["run", "build"]
},
{
"label": "build:debug",
"type": "cargo",
"command": "build",
"options": {
"cwd": "${workspaceRoot}/src-tauri"
}
},
{
"label": "dev",
"dependsOn": ["build:debug", "ui:dev"],
"group": {
"kind": "build"
}
}
]
}
F5 or select debug configuration from Run menupreLaunchTask runs the dev server automaticallyNOTE: LLDB bypasses the Tauri CLI, so
beforeDevCommandandbeforeBuildCommandmust be configured as tasks.
If your project lacks a top-level Cargo.toml, create a workspace file:
[workspace]
members = ["src-tauri"]
Or attach src-tauri/Cargo.toml via the Cargo tool window.
Create two configurations in Run | Edit Configurations:
run--no-default-featuresThe --no-default-features flag is critical - it tells Tauri to load assets from the dev server instead of bundling them.
For Node-based projects:
devFor Rust WASM (Trunk):
trunk serveDownload codelldb from GitHub releases and note the installation path.
Add to your Neovim config (init.lua or equivalent):
local dap = require("dap")
-- Configure codelldb adapter
dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = '/path/to/codelldb/adapter/codelldb',
args = {"--port", "${port}"},
}
}
-- Launch configuration for Rust/Tauri
dap.configurations.rust = {
{
name = "Launch Tauri App",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false
},
}
local dapui = require("dapui")
dapui.setup()
-- Auto-open/close UI
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
vim.fn.sign_define('DapBreakpoint', {
text = 'B',
texthl = 'DapBreakpoint',
linehl = '',
numhl = ''
})
vim.fn.sign_define('DapStopped', {
text = '>',
texthl = 'DapStopped',
linehl = 'DapStopped',
numhl = ''
})
vim.keymap.set('n', '<F5>', function() dap.continue() end)
vim.keymap.set('n', '<F6>', function() dap.disconnect({ terminateDebuggee = true }) end)
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
vim.keymap.set('n', '<F11>', function() dap.step_into() end)
vim.keymap.set('n', '<F12>', function() dap.step_out() end)
vim.keymap.set('n', '<Leader>b', function() dap.toggle_breakpoint() end)
vim.keymap.set('n', '<Leader>o', function() overseer.toggle() end)
vim.keymap.set('n', '<Leader>R', function() overseer.run_template() end)
Create .vscode/tasks.json for overseer.nvim compatibility:
{
"version": "2.0.0",
"tasks": [
{
"type": "process",
"label": "dev server",
"command": "npm",
"args": ["run", "dev"],
"isBackground": true,
"presentation": {
"revealProblems": "onProblem"
},
"problemMatcher": {
"pattern": {
"regexp": "^error:.*",
"file": 1,
"line": 2
},
"background": {
"activeOnStart": false,
"beginsPattern": ".*Rebuilding.*",
"endsPattern": ".*listening.*"
}
}
}
]
}
NOTE: The development server does not start automatically when bypassing Tauri CLI. Use overseer.nvim or start it manually.
CrabNebula DevTools provides real-time application instrumentation including log inspection, performance monitoring, and Tauri event/command analysis.
cargo add [email protected]
Initialize DevTools as early as possible in src-tauri/src/main.rs:
fn main() {
// Initialize DevTools only in debug builds
#[cfg(debug_assertions)]
let devtools = tauri_plugin_devtools::init();
let mut builder = tauri::Builder::default();
#[cfg(debug_assertions)]
{
builder = builder.plugin(devtools);
}
builder
.run(tauri::generate_context!())
.expect("error while running tauri application")
}
When running tauri dev, DevTools automatically opens a web-based interface showing:
For full documentation, see CrabNebula DevTools docs.
| Task | Command/Action |
|------|----------------|
| Enable backtraces | RUST_BACKTRACE=1 tauri dev |
| Open WebView DevTools | Ctrl+Shift+i / Cmd+Option+i |
| Debug build | tauri build --debug |
| Add DevTools plugin | cargo add [email protected] |
| Feature | VS Code | RustRover | Neovim | |---------|---------|-----------|--------| | Extension/Plugin | vscode-lldb | Built-in | nvim-dap + codelldb | | Windows Alt | cppvsdbg | Built-in | codelldb | | Task Runner | tasks.json | Run configs | overseer.nvim | | Setup Complexity | Medium | Low | High |
--no-default-features is set when buildingpreLaunchTask or start manuallydevelopment
Enforce web security and avoid security vulnerabilities
development
Guides users through distributing Tauri applications on Windows, including creating MSI and NSIS installers, customizing installer behavior, configuring WebView2 installation modes, and submitting apps to the Microsoft Store.
documentation
Guides users through Tauri window customization including custom titlebar implementation, transparent windows, window decorations, drag regions, window menus, submenus, and menu keyboard shortcuts for desktop applications.
tools
Assists users with updating Tauri dependencies including the Tauri CLI, Rust crates, JavaScript packages, and checking for outdated versions to upgrade to the latest version.