Skip to content
CFX Tebex Store

Updated July 16, 2026 4 min read

Debugging FiveM NUI: Chrome DevTools, Console Tricks and the Most Common JavaScript Errors

Debugging FiveM NUI: Chrome DevTools, Console Tricks and the Most Common JavaScript Errors

Debugging FiveM NUI: Chrome DevTools, Console Tricks and the Most Common JavaScript Errors

NUI (New UI) is the Chromium-based browser layer that powers most modern FiveM script interfaces — inventory grids, phone apps, MDT panels, prop placement menus. When NUI breaks, players see a blank panel, a frozen UI, or nothing at all, and the fix almost always lives in a JavaScript error that only appears if you know where to look. This guide covers how to open the actual developer tools, what errors to expect, and how to fix the most common categories.

Opening NUI DevTools in FiveM

The Chromium debug interface for FiveM’s NUI layer is accessible via the CEF remote debugging protocol. Enable it by starting your FiveM client with the +set citizen_developer 1 launch argument. Once in-game with a NUI resource active:

  1. Open a browser on the same machine and navigate to http://localhost:13172/
  2. You will see a list of NUI pages — one per active resource that has a browser frame open
  3. Click the resource you want to debug — it opens a full Chrome DevTools panel connected to that NUI page

From here, Console, Sources, Network, and Elements all work as they do on a normal web page. This is the primary FiveM script debugging interface and most script developers assume you have access to it when you file a bug report.

The Most Common NUI Console Errors

CORS / net::ERR_FAILED on Fetch

NUI pages can only make requests to https://cfx-nui-{resourcename}/ endpoints or external URLs explicitly allowed in the resource manifest. A fetch to http://localhost/anything or to an external API without is_allowed_nui_page declared will fail silently from the player perspective and appear as net::ERR_FAILED in the console. Fix: add the allowed domain to the resource’s fxmanifest.lua or confirm the NUI callback is using the correct fetch(`https://cfx-nui-${GetCurrentResourceName()}/endpoint`) pattern.

Uncaught TypeError: Cannot read properties of undefined

The most common JavaScript error in FiveM NUI. Caused by a SendNUIMessage event arriving at the browser before the React/Vue component is fully mounted, or a missing key in the message payload. The fix in most cases: guard the data access with optional chaining (data?.property) or ensure the mount lifecycle completes before registering the NUI message listener. Resources that fail on first open but work after a relog are almost always hitting this race condition.

Blank White Panel / Nothing Rendering

If the DevTools console shows no errors but the NUI frame is blank, the issue is usually the resource’s HTML file path. Check that ui/index.html (or whatever the entry point is) exists at the declared path, that it is not empty after a script update, and that there are no syntax errors in the bundled JavaScript. A blank NUI with no console errors means the HTML is loading but the JavaScript bundle has crashed silently at the module level.

React / Vue Hydration Errors

Modern FiveM NUI scripts often use React or Vue. Hydration errors appear when server-rendered HTML doesn’t match client-side state on mount. In FiveM’s context this is less common (most NUI is fully client-rendered), but if you see hydration-related warnings, check that the component’s initial state is not referencing window or document objects that don’t exist in the FiveM Chromium context.

Recommended FiveM scripts for your server


NUI Performance Issues: Console Timing

NUI lag — where the inventory opens slowly or the phone feels sluggish — is often not a JavaScript performance issue but a SendNUIMessage delay. The FiveM bridge between Lua and the browser layer is asynchronous; large payloads (an inventory with 200+ items, for example) take longer to serialize and transmit. Diagnose this by timing from the Lua SendNUIMessage call to the browser’s receipt of the message using console.time() in the NUI handler. If the delay is in the bridge, the fix is to paginate or lazy-load the payload, not to optimise the JavaScript itself.

Using the Network Tab for API Debug

When a NUI resource makes callbacks to the FiveM server via fetch, the Network tab shows every request and response. This is the quickest way to confirm whether a callback is firing, what data it’s sending, and what the server is returning. A 404 on a callback URL means the resource’s callback handler isn’t registered (check the Lua server.lua event registration). A 200 with no response body means the handler returned nil — check the cb(response) call in the Lua callback.

Upgrade your server — shop our FiveM scripts


Debugging Without DevTools Access

On a live production server, you won’t have DevTools open. Log NUI errors to a Discord webhook from the JavaScript side by wrapping the global error handler:

window.onerror = (msg, src, line, col, err) => {
  // send to server via NUI callback for logging
  fetch(`https://cfx-nui-${GetCurrentResourceName()}/logerror`, {
    method: 'POST',
    body: JSON.stringify({ msg, src, line })
  });
};

This captures uncaught errors in production and delivers them via the logging infrastructure you already have in place. For a complete look at server-side and admin-level logging that complements client-side NUI logging, the guides on febex.io cover the full audit trail. For the script configuration and update management that often triggers NUI regressions, the update workflow guides on cfx-tebex.store include pre-update testing procedures that catch NUI breakage before it hits players.

From the store

Best sellers

All scripts

Read next