ESX 'No such export getSharedObject in resource es_extended' – Fix
The error
SCRIPT ERROR: No such export getSharedObject in resource es_extended SCRIPT ERROR: @my-resource/server/main.lua:3: attempt to call a nil value (field 'getSharedObject')
What it means
The script asked es_extended for the getSharedObject export, but that export was not available. Either es_extended is not running under that exact folder name, it failed while starting, or you are on an older ESX build that only answered the esx:getSharedObject event. This is the export-side version of the deprecated-event problem covered on the getSharedObject page.
The fix
-- ESX Legacy (current): use the export
local ESX = exports['es_extended']:getSharedObject()
-- Older ESX that has no export yet:
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Start the framework first:
ensure oxmysql
ensure es_extended
ensure [core]
ensure my-resource
The folder must be named exactly es_extended. If you recently updated to ESX Legacy, replace the old event in every file — the event was removed, which is why newer cores only answer the export. If you are still on a pre-Legacy build, the export does not exist and you should keep the event (or update the framework). When many scripts fail together, fix the first es_extended start error; until the core publishes its export, every script that calls it will print this line.
Related: ESX getSharedObject deprecated and QBCore No such export GetCoreObject.
These steps are for creators and server owners working on their own scripts. Test the change on a development server or in Studio before you put it live.
Related tools: ESX script generator · Fix a FiveM Lua error · all script generators