esx:getSharedObject never fires
A script uses an old way of connecting to ESX that modern ESX removed. There is no error — it just silently never works.
Do this first
The script needs one line changed. Ask the seller for an ESX Legacy version.
What it means
TriggerEvent('esx:getSharedObject', cb) was how every ESX script obtained the core object for years. ESX Legacy removed the event. The trigger does not error — nothing listens, so the callback simply never runs and ESX stays nil forever.
A feature that silently never initialises is worse than an error, and this is the most common cause of "the script does nothing and there is nothing in the console".
What causes it
Ordered by how often it is the answer.
- 1
A script written for ESX 1.1 running on ESX Legacy
By far the most common. Thousands of published scripts still use it.
- 2
The pattern copied from an old tutorial
Most FiveM tutorials online predate Legacy.
- 3
A half-migrated resource
One file updated to the export, another still using the event.
How to tell which one is yours
grep -rn "getSharedObject" my-script/
If it appears as a TriggerEvent, it is the old pattern. If ESX is nil AND there is no error in the console at all, this is almost certainly why.
Where to look
The top of every client and server file in the resource.
How to fix it
-- old, does nothing on ESX Legacy
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
-- current
ESX = exports['es_extended']:getSharedObject()The export is synchronous, so the line below it can use ESX immediately.
Still stuck on your own code?
This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.
bug_reportOpen Server Fixer