Fix 'No Such Export in Resource' Errors in FiveM
Fix 'No such export in resource' in FiveM: find why the export is missing, then check the resource name, start order, client or server side and version.
- Applies to
- FiveM Legacy and FiveM for GTAV Enhanced servers; Lua and JavaScript resources; FiveM runtime source of November 17, 2026; Qbox (qbx_core v1.24.1), ESX Legacy 1.16.4 and QBCore 1.3.0, the current versions on November 21, 2026
- Last verified
On this page
- Direct Answer
- What “No such export … in resource …” means
- “SCRIPT ERROR: No such export” or “Error loading script”: when the call ran
- How to fix “No such export” step by step
- “No such export GetCoreObject in resource qb-core” and other framework errors
- FiveM Legacy and FiveM for GTAV Enhanced
- Export error messages and what they mean
- Troubleshooting
- Next Steps
Direct Answer
No such export X in resource Y means a script asked the resource named Y for an export called X, and nothing answered. FiveM looks an export up by the exact resource name, among running resources only, on the side (client or server) where the call runs. Fix it in order: if Y failed to start, fix its first error; check that a resource folder is named exactly Y (on Qbox, qbx_core answers for qb-core); start Y before the script, or add dependency 'Y' to the script’s manifest; call X from the side that registers it; update Y if X only exists in a newer version.
What “No such export … in resource …” means
An export is a function that one resource offers to other resources. The Cfx.re Lua documentation shows both halves. The resource that offers it, the provider, registers it by calling the global exports object:
exports('SayHello', function(str)
print('Hello, ' .. tostring(str) .. '!')
end)
Any other resource then calls it through the provider’s resource name:
-- Prints 'Hello, world!'
exports.myresource:SayHello('world')
An older form still exists: an export entry (client) or server_export entry (server) in fxmanifest.lua that names a global function. The manifest reference says to try the exports('name', ..) function instead.
How FiveM looks up an export
FiveM’s Lua runtime file scheduler.lua turns every export into a local event named __cfx_export_<resource>_<export>. The code quoted here is from the citizenfx/fivem repository at its commit of November 17, 2026. Calling exports('SayHello', ...) adds a handler for that event under the name of the resource running the line. A call such as exports.myresource:SayHello() triggers the event and then checks whether a handler handed back the function. This is the part that raises the error:
if not exportsCallbackCache[resource][k2] then
TriggerEvent(getExportEventName(resource, k2), function(exportData)
exportsCallbackCache[resource][k2] = exportData
end)
if not exportsCallbackCache[resource][k2] then
error('No such export ' .. k2 .. ' in resource ' .. resource, 2)
end
end
resource is the name written in the call and k2 is the export name. Four rules follow from this code:
- The resource name must match exactly. The event name is built from the name as you typed it. The only name the runtime rewrites is
txAdmin, which it maps tomonitorsince a change of May 9, 2025. - The provider must be running, and must have run its
exports(...)line. The handler is added at the moment that line executes. When a resource stops, the runtime empties its cache of that resource’s exports, “to avoid calling unexisting exports” in the words of the source comment. - The call must run on the same side.
TriggerEventis the local trigger. The events documentation describes it as the way to trigger “a server event from inside a server-side script, or trigger a client event from inside a client-side script”. A client export cannot answer a server script, and the reverse. - Your copy of the provider must contain the export. If the installed version never registers X, no handler will ever answer.
JavaScript resources behave the same way: the JS runtime builds the same __cfx_export_ event name and throws No such export ${k} in resource ${resource}. FiveM’s C# export code also builds that event name, but it does not print this message when nothing answers, so a C# script fails differently.
Why provide does not answer exports
The manifest entry provide marks a resource as a replacement that “will act as if it is said resource if started”. It counts for dependencies: the reference says the replacement will “start instead of the specified resource, if another resource requires it”. The export lookup does not consult it. A replacement answers the old name only if it registers handlers under that name itself. oxmysql, which its documentation calls “A replacement of mysql-async and ghmattimysql”, does exactly that in its source:
function provide(resourceName: string, method: string, cb: Function) {
on(`__cfx_export_${resourceName}_${method}`, (setCb: Function) => setCb(cb));
}
Qbox follows the same idea for QBCore scripts. qbx_core declares provide 'qb-core', and its bridge registers the QBCore-style exports through a helper named createQbExport, which adds a handler for __cfx_export_qb-core_<name>. That is why exports['qb-core'] calls work on Qbox without a qb-core folder.
“SCRIPT ERROR: No such export” or “Error loading script”: when the call ran
The text before the message tells you when the failing call ran, which narrows the cause.
| Line begins with | The call ran | Printed by |
|---|---|---|
Error loading script <file> in resource <name>: | At the top level of the file, while it loaded | The Lua runtime, when running the file fails |
SCRIPT ERROR: | Later, in a Lua thread; the scheduler runs every event handler as one | The Lua runtime, when a thread fails |
error during NUI callback <name>: | Inside a NUI callback, on the client | scheduler.lua |
This console output from a forum post of February 9, 2022 shows the whole chain:
[ c-resources-core] Resource 'pma-voice' can't run:
[ c-resources-core] 1. onesync: OneSync needs to be enabled
[ citizen-server-impl] Couldn't start resource pma-voice.
[ c-scripting-core] Creating script environments for qb-radio
[ script:qb-radio] Error loading script server.lua in resource qb-radio: citizen:/scripting/lua/scheduler.lua:867: No such export addChannelCheck in resource pma-voice
[ script:qb-radio] stack traceback:
[ script:qb-radio] [C]: in function 'error'
[ script:qb-radio] citizen:/scripting/lua/scheduler.lua:867: in metamethod 'index'
[ script:qb-radio] @qb-radio/server.lua:24: in main chunk
[ c-scripting-core] Failed to load script server.lua.
[ citizen-server-impl] Started resource qb-radio
Read it from the top:
- The export error is a consequence. The first three lines report that
pma-voice“can’t run” because a requirement in its manifest failed, and that FXServer could not start it. No provider, no export. - The traceback names the calling line.
@qb-radio/server.lua:24: in main chunkis the file and line that made the call. The Lua manual calls the unit of compilation a chunk, and a chunk “can be stored in a file”, so “main chunk” means the top level of that file. - “Started resource” does not mean the script works. FXServer prints
Failed to load script server.lua.and moves on to the resource’s next file, soqb-radiostarts without the code of that file.
The position printed before the message varies. This post shows a line inside citizen:/scripting/lua/scheduler.lua; other posts show the calling script’s own file, such as @wasabi_backpack/server/server.lua:42 in a post from March 26, 2023. The current scheduler raises the error with level 2, which the Lua manual says “points the error to where the function that called error was called”. In either form, the two names inside the message are what you act on. The bracketed tag can be cut short ([script:wasabi_backpa] in that post), so take the calling resource’s name from the path after @.
How to fix “No such export” step by step
These steps apply to FiveM Legacy and FiveM for GTAV Enhanced alike, and to every framework.
-
Find the provider’s first error. Scroll up the server console to where resource Y starts. These are the lines FXServer prints there:
Console line Meaning Couldn't find resource Y.No resource with that name exists: the folder is missing or named differently Couldn't start resource Y.Y failed to start and stayed stopped Could not find dependency Z for resource Y.Y needs a resource Z that is not installed Could not start dependency Z for resource Y.Z is installed but failed to start, so Y did not start either Resource 'Y' can't run:and a numbered listA requirement in Y’s manifest, such as OneSync or a minimum server build, is not met Started resource YY started, but one of its files can still have failed with Failed to load scriptFix Y before anything else. ox_inventory’s Common Issues page puts this first among the causes of its own export errors: “An error occurred while starting ox_inventory or one of its dependencies (e.g. ox_lib).” To retry after a fix, type
ensure Yin the console.ensurestarts a stopped resource and restarts a started one. Thenensurethe script that showed the error too: its failed file only loads again when the script restarts. -
Compare the names. A resource’s name is its folder name; folders in
[brackets]are categories that hold resources. The name in the call must match the folder character for character. A forum thread of February 26, 2022 shows the classic case: a script calledexports['m-core']:GetCoreObject()on a server that ran qb-core, and the reply was to useexports['qb-core']. In Lua,exports.nameandexports['name']are the same lookup, but the dot form only accepts names made of “Latin letters, Arabic-Indic digits, and underscores”. A name with a dash, such asqb-core, needs the brackets. On Qbox, a call toqb-coreneeds noqb-corefolder:qbx_coreanswers it while its bridge is on (see step 5). If you rename a folder while the server runs, typerefreshfirst, which “Rescans the resources folder and loads all resource manifests in them”, thenensurethe provider and the script. -
Start the provider before the script. A call at the top of a file runs the moment the file loads, so the provider must already be running. ox_inventory’s second cause is a script that starts before ox_inventory, and Overextended’s oxmysql guide says to add oxmysql “to the top of your resource list”. The official Qbox recipe starts ox_lib and qbx_core before its resource categories:
ensure ox_lib ensure qbx_core ensure ox_target ensure [ox] ensure [qbx] ensure [standalone] ensure [voice]Move the script’s
ensureline below its provider, or make the order automatic in the script’sfxmanifest.lua. This is the manifest reference’s example; put the provider’s name in place ofmyresource-base:dependency 'myresource-base'The reference says
dependency“Requires the specified resource to load before the current resource”. In FXServer’s source, a dependency that is neither starting nor started is started first. A missing one stops the script withCould not find dependency <name> for resource <name>.and one that fails to start stops it withCould not start dependency <name> for resource <name>., both clearer messages thanNo such export. -
Call the export on the side that registers it. Open the provider’s folder and search its files for the export name from your error; the examples below use
registerHookfrom the ox_inventory error above. On Linux, run this inside the provider’s folder;-rsearches every file below the current folder and-nprints line numbers:grep -rn "registerHook" .On Windows, open Command Prompt in the provider’s folder;
/ssearches subfolders,/nprints line numbers and/c:takes the text literally. Use*.jsinstead of*.luafor JavaScript resources:findstr /s /n /c:"registerHook" *.luaThen look up the file that matched in the provider’s
fxmanifest.lua. Underclient_scriptit is loaded “on the client”, underserver_script“on the server”, and undershared_script“on both sides”. In the old manifest form,exportmeans client andserver_exportmeans server. If the file is not listed there, another file of the provider loads it; check the provider’s documentation instead. ox_inventory shows the split in its docs:openInventoryis listed on its Client functions page, whileforceOpenInventoryis on the Server page. A server file that calls a client-only export, or the reverse, getsNo such exporteven with the provider running. Crossing sides needs a network event (TriggerServerEventorTriggerClientEventin the events docs), which is a change for the script’s author. -
Match the provider’s version to the script. If the export name appears in none of the provider’s files, your copy does not have it. ox_inventory’s third cause is calling “an export that does not exist”. Three situations leave an export missing while the provider runs:
-
The export is newer than your copy. QBCore’s documentation states that “As of qb-core version 1.3.0 (check your fxmanifest.lua) all functions within the core object are exported”, so a script that calls a core function directly through
exports['qb-core']needs qb-core 1.3.0 or newer. In the 2023 thread withNo such export registerHook in resource ox_inventory, the answer was to update ox_inventory. -
The folder holds source code, not a release. An FAQ posted in the NPWD release thread on January 2, 2022 answers
no such export isPhoneVisiblewith “You downloaded the source code and didn’t build”, and points to the builtnpwd.zipon the releases page. ox_inventory gives the same download advice for its UI: its Common Issues page tells you to downloadox_inventory.zip, “as that one contains the bundled files and others are raw source code”. -
A setting switches the export off. The same FAQ says NPWD’s
newPlayerexport “is only available when the useResourceIntegration is set to true”. Qbox’s bridge files begin with this line, so none of itsqb-coreexports exist when the convar isfalse:if GetConvar('qbx:enablebridge', 'true') == 'false' then return end
Compare the
versionline in the provider’sfxmanifest.luawith what the script requires. That line can lag behind the release: in ESX’s 1.16.4 release tag, thees_extendedmanifest still readsversion '1.16.3', so check the release notes too. Then update the provider from its official release, or install the script version made for yours. -
-
Check how the script calls it. The scheduler hands back
function(self, ...), so the first parameter is reserved for the colon call. The Lua manual explains why: “A call v:name(args) is syntactic sugar for v.name(v,args)”. Withexports.myresource:SayHello('world')the export receives'world'. With a dot,'world'lands inselfand the export receives nothing. ox_lib’s owninit.luauses the dot form and passesnilin that slot on purpose:export[index](nil, ...). This mistake gives wrong results rather thanNo such export, so check it when an export runs but does nothing.
“No such export GetCoreObject in resource qb-core” and other framework errors
The framework cores are providers like any other, and the same rules apply. Four variants have causes of their own:
| Error | Cause | Fix |
|---|---|---|
No such export GetCoreObject in resource qb-core | qb-core is not running under that name, started after the script, or (on Qbox) the bridge is switched off | Steps 1 to 3, then the QBCore nil value guide |
No such export GetCoreObject in resource qbx_core | The Qbox FAQ: “Qbox does not have the core object” | Call exports['qb-core']:GetCoreObject(), which the bridge answers |
No such export getSharedObject in resource es_extended | es_extended was not running when the script ran the call | Steps 1 to 3, then the ESX getSharedObject guide |
No such export ... in resource ox_inventory | One of the three causes on ox_inventory’s Common Issues page | Steps 1, 3 and 5 |
These are the lines each core documents. QBCore’s docs give this pattern for the top of a script:
local QBCore = exports['qb-core']:GetCoreObject()
ESX’s developer tutorial loads the core into a script with '@es_extended/imports.lua' in the script’s shared_scripts. That file makes the export call as soon as the script loads, so es_extended must already be running. Its first statement in ESX Legacy 1.16.4 is:
ESX = exports["es_extended"]:getSharedObject()
When a QBCore script on Qbox calls exports of a QBCore resource that Qbox replaces, the QBCore to Qbox migration guide lists the replacements. Whatever the source of a script, including FiveCrate’s FiveM scripts category, read its manifest’s dependency lines and the framework and versions it expects before you start it.
FiveM Legacy and FiveM for GTAV Enhanced
The Enhanced “What’s Changed” page lists no change to exports, to dependency or to the Lua scheduler, so the steps above are the same on both platforms. Two Enhanced changes can still affect the provider itself, and a provider that does not run shows up as a missing export:
- Escrow-protected providers. The page lists Asset Escrow under Removed Features with the note “Not implemented yet”. If the provider is escrow-protected, read the FiveM Enhanced server guide before you debug the export.
- C# providers. “Mono was replaced by .NET”, and Cfx says it will share more on “what this means for developers in the future”. Check with the provider’s author that its C# build supports Enhanced.
Export error messages and what they mean
The FiveM runtime prints these messages around exports (Lua scheduler and JS runtime, source of November 17, 2026):
| Message | Meaning |
|---|---|
No such export <name> in resource <resource> | No handler answered on this side (Lua and JavaScript) |
Invalid export name: <value> | The export name in the call is not a string, for example a nil variable from a config |
An error occurred while calling export `<name>` in resource `<resource>`: | The export exists and failed inside the provider; the provider’s error follows, indented. Output over 2048 characters is cut to its first and last 1024 |
An error occurred while calling export <name> of resource <resource> - see above for details | The JavaScript form of the same failure |
cannot set values on exports or cannot set values on an export resource | A script tried to assign a value into exports |
ox_lib must be started before this resource. | The script loads @ox_lib/init.lua while ox_lib is not started; init.lua checks this before it calls any ox_lib export. Start ox_lib first (step 3) |
Troubleshooting
“No such export” appeared after I restarted a resource
Restarting a provider affects the scripts that use it in two ways:
- Scripts with a
dependencyline on it stop with it. When a resource stops, FXServer stops every resource that lists it as a dependency, and a comment in the source ofensurewarns that this leaves the dependent resource “stopping but not being started again”. After restarting a provider on a live server,ensureeach resource that depends on it, or restart the whole server. - Scripts without a
dependencyline keep running. The runtime emptied their cache of the provider’s exports when it stopped, so their next call looks the export up again. A call made while the provider is stopped, or after it failed to start again, getsNo such export. Look for the provider’s own errors after the restart, as in step 1.
The provider says “Started resource” but the export is still missing
One of the provider’s own files failed. Look under the provider’s name for Failed to load script <file>. and the error above it. A file that stops before its exports(...) line never registers the export, while the rest of the resource starts normally. Fix that error, ensure the provider again, then ensure the script that called it.
An export declared in fxmanifest.lua is never found
For the export and server_export entries, the Lua docs say “Functions need to be global to be ‘explicitly’ exported”. The scheduler looks the function up in the global table, so a local function is never found. The same docs note that these exports “will only be available after the first scheduler tick”. The exports('name', function ... end) form avoids both problems.
The export works in server files but not in client files
The provider registers it on one side only. Search for the file that registers it and check where fxmanifest.lua loads that file, as in step 4. Client scripts reach server code through events, not exports.
“Invalid export name: nil”
The export name in the call is nil: the script reads it from a variable that has no value, for example a missing config entry. The runtime added this check on June 25, 2025, in a change titled “prevent script error on nil export call”. Fix the config entry the script reads.
“An error occurred while calling export”
This is not a missing export. The provider answered, and its function then failed. The indented text under the message is the provider’s own error. Debug the provider, or the arguments the script passes to it.
Exports not working, but no “No such export” error
The export exists, so the problem is in the call or inside the provider. Check the colon in the call (step 6), then search the console for “An error occurred while calling export”.
Next Steps
- Set up folders, dependencies and the start order with How to install FiveM scripts.
- Learn what
client_script,server_script,dependencyandprovidedo in fxmanifest.lua explained. - If the provider itself will not start, work through Couldn’t start resource.
FiveM scripts from FiveCrate
Listed in the FiveCrate catalogue now.
Official documentation and repository references
Related guides
Fix FiveM 'Couldn't Start Resource' and Dependency Errors
Couldn't start resource in FiveM means a start check failed. Read the line above it, then fix the dependency, manifest, server build or folder name.
fxmanifest.lua Explained for FiveM Server Owners
What each fxmanifest.lua line does in a FiveM resource: fx_version, game, scripts, files, data_file, dependencies, __resource.lua, lua54 and manifest errors.
How to Install FiveM Scripts and Resources Safely
How to install FiveM scripts: check the files, put the folder in resources, add its dependencies and SQL, then set the ensure order in server.cfg.
Fix 'getSharedObject Event No Longer Exists' and ESX is nil
Fix the ESX getSharedObject event no longer exists error and ESX is nil: which es_extended versions cause it, and how to update ESX or convert the script.
Fix: attempt to index a nil value (global 'QBCore')
Fix attempt to index a nil value (global 'QBCore') on QBCore and Qbox: replace the removed import.lua with GetCoreObject, fix start order, check the bridge.


