I've got a resource that calls exports.inventory:getItemCatalog() at file scope level, then passes that catalog to a registration function. This works fine normally, but on a cold server start I get a nil error from that export call.
What's weird is if I manually restart just my consumer resource after the server is running, it works perfectly. The inventory resource is definitely loaded - I can see it in the resource list and other things depend on it successfully.
Here's the failing code:
local catalog = exports.inventory:getItemCatalog()
registerShops(catalog)It seems like during cold start, my resource is evaluating its top-level code before the inventory resource has its exports ready, even though both resources are starting up. Is there something I'm missing about startup ordering? Should I be deferring this call somehow?
SniperWolf · 27/08/2026
Sign in to reply.