Debugging Tools for QBCore
Need an interactive debugger? Try our Event Debugger and Config Validator for hands-on troubleshooting.
Overview
Debugging a QBCore server involves monitoring server logs, tracing events, validating configuration files, and profiling resource performance. This page highlights built-in utilities and community tools that streamline the process.
Essential Tools
Capture client/server events in real time to see what scripts are firing and when.
Event DebuggerValidate JSON, Lua, and YAML configs to catch typos before restarting your server.
Config ValidatorQuickly scaffold boilerplate for new resources with consistent patterns and exports.
Code GeneratorRecommended Workflow
- Reproduce the Issue: Collect exact steps and player identifiers.
- Check Console Logs: Review both server logs and the F8 client console for errors or warnings.
- Trace Events: Use the Event Debugger to capture the relevant triggers.
- Validate Configs: Run configuration files through the validator to catch syntax issues.
- Inspect Database: Ensure that tables and data exist for the resource you’re debugging.
- Profile Performance: Use the FiveM profiler (
profiler view
) to catch slow resource loops.
Common Debugging Tasks
Fixing Missing Items
- Verify the item exists in
qb-core/shared/items.lua
. - Ensure the item image is placed in the correct inventory
html/images
directory. - Restart the inventory resource and check for console errors.
Tracking Event Spam
- Open the Event Debugger and set filters for the events you expect.
- If you see unexpected spam, locate the triggering script and add rate limiting.
- Use the FiveM
sv_eventLog
cvar to log to console for deeper analysis.
Validating Configuration Changes
- Paste your configuration into the Config Validator.
- Fix warnings about duplicate keys or invalid JSON/Lua syntax.
- Commit changes to version control so you can roll back if needed.
Tips
- Run your server with
+set onesync on
and watch for resource warnings when scaling player slots. - Keep a staging server for testing major updates.
- Use Git branches or tags to track changes to configuration files and custom scripts.
- Enable debug logging in individual resources (
Config.Debug = true
) only while investigating issues.