Error (global 'ESX')

Hello, I can’t seem to fix this problem.

i try to reinstall es_extended, essentialmod but nothing works

================================================================
======== FXServer starting - 19/07/2021 à 13:19:30

Could not register with breakpad server.
[ c-scripting-core] Creating script environments for _cfx_internal
[ citizen-server-impl] Scanning resources.
[ c-resources-core] Resource loading for fivem-es_extended-master failed:
[ c-resources-core] Could not open resource metadata file - no such file.
[ c-resources-core] Resource loading for HUD-GTAVRP failed:
[ c-resources-core] Could not open resource metadata file - no such file.
[ c-resources-core] Resource loading for ESX-Snippet failed:
[ c-resources-core] Could not open resource metadata file - no such file.
[ citizen-server-impl] Found 134 resources.
[ citizen-server-impl] Some resources have an outdated resource manifest:
[ citizen-server-impl] - CalmAI
[ citizen-server-impl] - ProtectPnj
[ citizen-server-impl] - esx_minerjob
[ citizen-server-impl] - hungerthirst
[ citizen-server-impl] - menu
[ citizen-server-impl] - skincreator
[ citizen-server-impl] - speedometer
[ citizen-server-impl]
[ citizen-server-impl] Please update these resources.
[ c-scripting-core] Creating script environments for sessionmanager
[ citizen-server-impl] Started resource sessionmanager
[ c-scripting-core] Creating script environments for monitor
[ script:monitor] [txAdminClient] Version 4.4.0 starting…
[ citizen-server-impl] Started resource monitor
[ c-scripting-core] Creating script environments for mapmanager
[ citizen-server-impl] Started resource mapmanager
[ c-scripting-core] Creating script environments for yarn
[ citizen-server-impl] Started resource yarn
[ c-scripting-core] Creating script environments for webpack
[ citizen-server-impl] Started resource webpack
[ c-scripting-core] Creating script environments for chat
[ citizen-server-impl] Started resource chat
[ citizen-server-impl] Started resource spawnmanager
[ script:mapmanager] Started gametype Freeroam
[ citizen-server-impl] Started resource basic-gamemode
[ citizen-server-impl] Started resource fivem
[ c-scripting-core] Creating script environments for hardcap
[ citizen-server-impl] Started resource hardcap
[ c-scripting-core] Creating script environments for rconlog
[ citizen-server-impl] Started resource rconlog
[ c-scripting-core] Creating script environments for mysql-async
[ citizen-server-impl] Started resource mysql-async
[ c-scripting-core] Creating script environments for essentialmode
[script:essentialmode] Instantiated instance of script SQLite.Main.
[ citizen-server-impl] Started resource essentialmode
[ c-scripting-core] Creating script environments for esplugin_mysql
[ citizen-server-impl] Started resource esplugin_mysql
[ c-scripting-core] Creating script environments for es_admin
[ citizen-server-impl] Started resource es_admin
[ c-scripting-core] Creating script environments for es_extended
[ citizen-server-impl] Started resource es_extended
[ c-scripting-core] Creating script environments for instance
[ citizen-server-impl] Started resource instance
[ c-scripting-core] Creating script environments for cron
[ citizen-server-impl] Started resource cron
[ citizen-server-impl] Started resource skinchanger
[ c-scripting-core] Creating script environments for esx_skin
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_skin] Error loading script server/main.lua in resource esx_skin: @esx_skin/server/main.lua:34: attempt to index a nil value (global ‘ESX’)
[ script:esx_skin] stack traceback:
[ script:esx_skin] @esx_skin/server/main.lua:34: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.
[ citizen-server-impl] Started resource esx_skin
[ citizen-server-impl] Started resource esx_menu_default
[ citizen-server-impl] Started resource esx_menu_list
[ citizen-server-impl] Started resource esx_menu_dialog
[ c-scripting-core] Creating script environments for esx_phone
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_phone] SCRIPT ERROR: @esx_phone/server/main.lua:6: attempt to index a nil value (global ‘ESX’)
[ citizen-server-impl] Started resource esx_phone
[ c-scripting-core] Creating script environments for esx_addonaccount
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ citizen-server-impl] Started resource esx_addonaccount
[ c-scripting-core] Creating script environments for esx_addoninventory
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ citizen-server-impl] Started resource esx_addoninventory
[ c-scripting-core] Creating script environments for esx_datastore
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ citizen-server-impl] Started resource esx_datastore
[ c-scripting-core] Creating script environments for esx_society
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_society] Error loading script server/main.lua in resource esx_society: @esx_society/server/main.lua:155: attempt to index a nil value (global ‘ESX’)
[ script:esx_society] stack traceback:
[ script:esx_society] @esx_society/server/main.lua:155: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.
[ citizen-server-impl] Started resource esx_society
[ c-scripting-core] Creating script environments for esx_service
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_service] Error loading script server/main.lua in resource esx_service: @esx_service/server/main.lua:36: attempt to index a nil value (global ‘ESX’)
[ script:esx_service] stack traceback:
[ script:esx_service] @esx_service/server/main.lua:36: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.
[ citizen-server-impl] Started resource esx_service
[ c-scripting-core] Creating script environments for esx_billing
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_billing] Error loading script server/main.lua in resource esx_billing: @esx_billing/server/main.lua:36: attempt to index a nil value (global ‘ESX’)
[ script:esx_billing] stack traceback:
[ script:esx_billing] @esx_billing/server/main.lua:36: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.
[ citizen-server-impl] Started resource esx_billing
[ c-scripting-core] Creating script environments for esx_identity
[ c-scripting-core] Failed to load script @es_extended/imports.lua.
[ script:esx_identity] Error loading script server/main.lua in resource esx_identity: @esx_identity/server/main.lua:3: attempt to index a nil value (global ‘ESX’)
[ script:esx_identity] stack traceback:
[ script:esx_identity] @esx_identity/server/main.lua:3: in main chunk
[ c-scripting-core] Failed to load script server/main.lua.
[ citizen-server-impl] Started resource esx_identity
[ svadhesive] Authenticating server license key…
[ script:monitor] [txAdminClient] Threads and commands set up. All Ready.
[script:essentialmode] Performing version check against: https://api.kanersps.pw/em/version?version=6.4.2&uuid=8d0233a1-187c-4a7c-91bb-9505ebb3daac
[script:essentialmode]
[ script:mapmanager] Started map fivem-map-hipster
[ citizen-server-impl] Started resource fivem-map-hipster
[ script:mysql-async] [mysql-async] [SUCCESS] Database server connection established.
[ svadhesive] Server license key authentication succeeded. Welcome!
[script:essentialmode]
[script:essentialmode] [EssentialMode] Current version: 6.4.2
[script:essentialmode] [EssentialMode] Updater version: 6.4.2
[script:essentialmode]
[script:essentialmode] [EssentialMode] Everything is nice and updated!
[script:essentialmode]
[script:essentialmode] Support the developers: Hey! Would you like to support the developers, go to G-Development is creating software | Patreon and get some nifty rewards!
[ citizen-server-impl] fff
[ citizen-server-impl] cccc ff xx xx rr rr eee
[ citizen-server-impl] cc ffff xx rrr r ee e
[ citizen-server-impl] cc ff xx … rr eeeee
[ citizen-server-impl] ccccc ff xx xx … rr eeeee
[ citizen-server-impl]
[ citizen-server-impl] Authenticated with cfx.re Nucleus: https://bibiflox-r3brqj.users.cfx.re/
[ citizen-server-impl] – [server notice: hostname_rework]
[ citizen-server-impl] You don’t have sv_projectName/sv_projectDesc set.
[ citizen-server-impl] These variables augment sv_hostname and fix your server name being cut off in the server list.
[ citizen-server-impl] Use sets sv_projectName .. and sets sv_projectDesc .. to set them.
[ citizen-server-impl]
[ citizen-server-impl] – [server notice: tebex_not_set]
[ citizen-server-impl] ================
[ citizen-server-impl] Monetize your server using Tebex! Visit https://tebex.io/fivem for more info.
[ citizen-server-impl] ================
[ citizen-server-impl]

fivem-es_extended-master :confused:
Always name it es_extended

Failed to load script @es_extended/imports.lua This is a ESX Legacy feature (aka 1.3)

essentialmode Only compatible with ESX 1.1 and the fork ExtendedMode

1 Like

What’s the internal reason that scripts “have” to be named something specific, is it becuase of the NUI callbacks or some other reason?

You can name a resource whatever you want, but any external references need to be updated to support that as well as any internal references to the resource name (often NUI).

Most people just rename their resource and call it a day, then break anything that use it as a dependency.

Ah ok, so exports are name, yeah good point.
For NUI at least and event names, I use GetCurrentResourceName() on resource launch and store the name which is then ued for all the event handlers. I also pass it to the setup called for NUI and the javascript then uses that for the base url. I wonder about making it dynamic for exports though…

For js you can do https://${GetParentResourceName()}

Nothing you can do about exports - it will export based on the current resource name and any reference to it needs to use that.

Maybe I should try building fxserver and find a way to make the exports module name
configurable