Syntax Error / Error Parsing
Fixing 'syntax error near <\1>' and 'Error parsing script' errors in FiveM.
Error Messages
You may see one of these 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.lua
Possible Causes
FileZilla damages escrow-protected files during transfer in its default mode. Use WinSCP instead, or switch FileZilla to binary transfer mode.
Transferring files one-by-one through RDP also damages them. Upload the .zip to the server and
extract it there.
Your server must be at least artifacts version 4752. Older builds can't load modern escrow resources.
The download itself may have been truncated or corrupted. Re-download from the CFX Portal.
A virus on your server may be modifying script files. This usually manifests as scripts working initially and breaking after a few restarts.
Solutions
Re-upload with WinSCP
Download the script again from the CFX Portal and upload using WinSCP instead of FileZilla.
Or: switch FileZilla to Binary mode
If you must use FileZilla:
- Open FileZilla
- Go to Transfer → Transfer Type → Binary
- Re-upload the entire resource
Update server artifacts
Run version in the server console. If it's below 4752, update.
- Download the latest recommended artifacts from the Windows artifacts page
- Stop your server
- Remove the old server folder and replace it with the new one
- Start the server and run
versionto confirm
- Download the latest recommended artifact from the Linux artifacts page
- Stop your server
- Delete the
cacheandalpinefolders - Extract with
tar -xf fx.tar.xz - Start the server and run
versionto confirm
Clear the server cache
Delete the cache folder in your server directory and restart.
Fresh install
If nothing else works:
- Delete the resource folder entirely
- Download a fresh copy from the CFX Portal
- Upload via WinSCP
- Disable any anticheat that dumps or modifies Lua files
- Restart the server
Related
General Issues
Overview of all escrow errors and how to identify which one you're seeing.
Failed to Verify Resource
Different error, same root cause as the corrupted-upload fix above.
Entitlement Error
If restarts stop loading the script entirely, you may be hitting this instead.
Was this page helpful?
TIMMYG Studios