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


Solutions

Re-upload with WinSCP

Download the script again from the CFX Portal and upload 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.

Or: switch FileZilla to Binary mode

If you must use FileZilla:

  1. Open FileZilla
  2. Go to TransferTransfer TypeBinary
  3. Re-upload the entire resource

Update server artifacts

Run version in the server console. If it's below 4752, update.

  1. Download the latest recommended artifacts from the Windows artifacts page
  2. Stop your server
  3. Remove the old server folder and replace it with the new one
  4. Start the server and run version to confirm

Clear the server cache

Delete the cache folder in your server directory and restart.

Fresh install

If nothing else works:

  1. Delete the resource folder entirely
  2. Download a fresh copy from the CFX Portal
  3. Upload via WinSCP
  4. Disable any anticheat that dumps or modifies Lua files
  5. Restart the server

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.