No such export in a resource
You call an export that doesn't exist or the resource didn't load. We explain the 3 causes and the fix.
The problem
The console shows «No such export 'X' in resource 'Y'» (or the export returns nil) when calling `exports['Y']:X()`.
The cause
Three typical causes: (1) resource 'Y' isn't started or loaded AFTER the one calling it; (2) the export or resource name is misspelled; (3) the export is registered on the other side (client vs server) from where you call it.
The solution
Check the load order, the exact name and the side (client/server):
lua
-- 1) ORDER in server.cfg: the resource that EXPORTS goes before the one using it.
ensure Y -- first the one providing the export
ensure my_script -- then the one calling it
-- 2) EXACT name (case and dash sensitive):
exports['ox_inventory']:AddItem(src, 'water', 1) -- correct
-- exports['ox-inventory'] <- wrong (dash vs underscore)
-- 3) Right side: a SERVER export doesn't exist on the client.
-- Check whether 'Y' registers that export in client.lua or server.lua.Step by step
- 1.Confirm resource 'Y' is in `ensure` and starts WITHOUT errors.
- 2.Put it BEFORE your script in server.cfg (dependencies first).
- 3.Check the exact resource and export name (case, dash vs underscore).
- 4.Make sure you call the export on the right side (client/server).
- 5.If 'Y' is paid/escrow, check its docs: the author sets the export name.
Related guides
Last updated: 2026-06-25. Crxative-M is not affiliated with Cfx.re or Rockstar Games.
