[Bug] Recursive glob expansion in client_scripts / server_scripts orders files case-insensitively, changing script load order
#14
Closed
ImBaphomettt
started this conversation in
[BUG] FiveM for GTAV Enhanced
Replies: 2 comments 1 reply
|
Thanks for the report. We are going to look into this. It is the same bug as #8. |
0 replies
|
A fix for this bug has been implemented and will be available in an upcoming hotfix patch that will go live within the next two hours. Please try again once the patch is live and let us know if the issue persists. Thanks for your help! |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Recursive glob expansion in
client_scripts/server_scriptsorders files case-insensitively, changing script load orderSummary
When a resource declares its scripts with a recursive glob such as
server_scripts { 'src/**/*.lua' }, the order in which the matched files are executed appears to follow a case-insensitive comparison of paths.For a codebase that names files in PascalCase and directories in lowercase a very common convention this inverts the load order relative to a case-sensitive
Concretely, given:
"Seeders"is a prefix of"Seeders.lua"once case is folded away, so theseeders/directory is walked beforeSeeders.luaexecutes.Foo.luathen runs against anilglobal and the chunk aborts withattempt to index a nil value (global 'Seeders').Issue type
Both / Unsure
Repro rate
Always
Server build version
FXServer-early-access b90 win32
OS
No response
CPU
No response
GPU
No response
RAM
No response
Storage type
None
Connection type
None
ISP and bandwidth
No response
DxDiag
No response
Network graph
No response
Platform
Windows
OS version / distribution
No response
CPU
No response
RAM
No response
Using txAdmin?
None
Hosting provider
None
Machine type
None
/perf endpoint output
No response
DDoS protection
No response
ulimit -n value (Linux only)
No response
Docker Compose file (Docker only)
No response
Steps to Reproduce
Steps to Reproduce
glob-order-reprowith this structure:fxmanifest.lua:.luafile contains exactly one line printing its own path:The four names are deliberately chosen so that a case-sensitive and a case-insensitive comparison disagree on two independent pairs:
scripts/Data.luaandscripts/data/. Folding case away makes"DATA"a prefix of"DATA.LUA", which flips their relative order.Plantings.luaandPlantingSpacial.luashare the prefixPlanting; the first differing character is's'(0x73) against'S'(0x53).Start the server and
ensure glob-order-repro.Read the four
[glob-order]lines in the console. Since each file prints as it executes, that output is the load order no interpretation needed.Repeat on the FXServer build where the resource previously worked, and compare the two outputs.
Expected Behavior
Works like Fivem Legacy
Actual Behavior
Files are ordered by a case-insensitive comparison, which inverts both pairs:
[glob-order] scripts/data/Item.lua
[glob-order] scripts/Data.lua
[glob-order] scripts/Plantings.lua
[glob-order] scripts/PlantingSpacial.lua
Every file in a subdirectory now executes before the parent-level file that defines the globals it depends on. In a real resource this surfaces as load-time failures spread across unrelated subsystems:
Evidence
No response
Additional Context
No response
All reactions