Syntax Error / Error Parsing
Fixing 'syntax error near <\1>' and 'Error parsing script' errors in FiveM.
Error Messages
You may see one of these errors in your server console:
syntax error near '<\1>'Error parsing script @your_resource/server/file.lua in resource your_resource:
@your_resource/server/file.lua:1: syntax error near '<\1>'Failed to load script @your_resource/server/file.luaPossible Causes
- FileZilla — FileZilla corrupts escrow-protected files during transfer. Use WinSCP instead
- Drag-and-drop via Remote Desktop — Transferring files one-by-one through RDP also damages them. Upload the
.zipfile and extract it on the server - Outdated server artifacts — Your server must be at least version 4752 or greater
- Corrupted download — The download itself may have been corrupted
- Server virus — A virus on your server may be modifying script files
Solutions
1. Re-upload with WinSCP
Download the script again from FiveM Keymaster and upload it using WinSCP instead of FileZilla.
Always upload the .zip file to your server first, then extract it there. Never transfer the folder file-by-file.
2. FileZilla Binary Mode
If you must use FileZilla, switch to binary transfer mode:
- Open FileZilla
- Go to Transfer → Transfer Type → Binary
- Re-upload the entire resource
3. Update Server Artifacts
Check your server version by running version in the server console.
If your version is below 4752, update your artifacts:
Windows
- Download the latest recommended artifacts from the Windows artifacts page
- Turn off your server
- Remove the old server folder and replace it with the newly downloaded version
- Start the server and run
versionto verify
Linux
- Download the latest recommended artifact from the Linux artifacts page
- Turn off your server
- Delete the
cacheandalpinefolders - Extract with:
tar -xf fx.tar.xz - Start the server and run
versionto verify
4. Clear Server Cache
Delete the cache folder in your server directory and restart.
5. Fresh Install
If nothing else works:
- Delete the resource folder entirely
- Download a fresh copy from FiveM Keymaster
- Upload via WinSCP
- Disable any anticheat that may dump or modify Lua files
- Restart the server
