THE ORB
Starting the studio

Failed to load script <file>

The server could not open one of the files a script is made of, so that script never ran at all.

groupsThat script does nothingpersonYou can fix this

Do this first

Check the file it names actually exists, spelled exactly the same way including capitals.

bug_reportPaste your whole console instead

What it means

The server found the resource and read its manifest, but could not load one of the files the manifest lists. This is a load failure, not a runtime error: nothing in the resource has executed.

What causes it

Ordered by how often it is the answer.

  1. 1

    The file does not exist at that path

    The manifest says client/main.lua and the file is client/Main.lua or client.lua. Linux servers are case sensitive and Windows is not, which is why this often appears only after moving to a real host.

  2. 2

    A syntax error in the file

    A missing end, an unclosed string, a stray character. The line above this one in the console carries the actual parse error.

  3. 3

    The file is listed in the wrong section

    A file in neither client_scripts nor server_scripts is never loaded at all.

  4. 4

    A glob that matches nothing

    client/*.lua in a folder with no .lua files.

  5. 5

    The file is empty or not UTF-8

    Saved as UTF-16, or carrying a BOM the parser rejects.

How to tell which one is yours

Scroll UP. FiveM prints the parse error immediately before this line when the cause is syntax. If there is no parse error above it, the path is wrong: check the exact case of every path segment.

Where to look

fxmanifest.lua, and the path exactly as written there.

How to fix it

fx_version 'cerulean'
game 'gta5'

client_scripts {
    'config.lua',
    'client/main.lua',   -- exact case, forward slashes
}
server_scripts {
    '@oxmysql/lib/MySQL.lua',
    'server/main.lua',
}

Still stuck on your own code?

This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.

bug_reportOpen Server Fixer

Errors that travel with this one