Stellar AI

Blog

QBCore Script Not Starting? Startup Fixes

Paste this into Stellar AI with your error:

“My QBCore resource is not starting. Here is my server console error, fxmanifest.lua, folder name, dependency list and the action I expected. Diagnose the likely cause first, then give me the smallest safe fix.”

1. Read the first real startup error

Do not start by changing random files. Restart the resource, then copy the first relevant error from the server console. One missing export or syntax error can trigger several follow-up messages. The first error usually points closest to the cause.

ensure qb-core
ensure ox_lib
ensure my-qbcore-resource
# Then check the first error after my-qbcore-resource starts.

2. Check the fxmanifest before the Lua

A wrong manifest can stop a perfectly good script from loading. Confirm the manifest file is called fxmanifest.lua, has the right game, includes all client/server files and lists shared config files before code that uses them.

  • Does the file name use lowercase fxmanifest.lua?
  • Are config files loaded with shared_scripts before client/server files need them?
  • Are file paths correct for your folder structure?
  • Are dependencies such as qb-core and ox_lib listed or started first?

3. Confirm dependency order

If your script calls exports['qb-core']:GetCoreObject(), QBCore must already be running. If you use ox_lib menus, callbacks or notifications, ox_lib needs to be available too. Put framework resources above your custom resource in server.cfg.

Common causeThe custom resource starts before qb-core, so exports are nil.Safe fixStart qb-core first, then libraries, then your custom resource.

4. Look for syntax errors and missing globals

A missing comma, bracket or end can prevent the file from loading. If the error mentions a line number, inspect that line and the few lines above it. Lua errors often point at the line where parsing finally failed, not always where the mistake began.

-- Bad: missing comma between table fields
Config.Items = {
  police_badge = { label = 'Police Badge' }
  evidence_bag = { label = 'Evidence Bag' }
}

5. Check folder names and resource names

Some scripts reference their own resource name, dependency names or export names. If you rename a folder, make sure any references match. Avoid spaces, special characters and duplicate copies of the same resource in your resources folder.

6. Test the smallest working version

Comment out optional features and confirm the resource can start with only the manifest, config and one simple server/client file. Then add features back one at a time. This narrows the issue faster than rewriting everything.

7. What to give an AI debugger

AI works best when it gets the exact facts. Paste:

  • the first server console error,
  • your fxmanifest.lua,
  • your folder name,
  • the relevant client/server file around the error line,
  • your dependencies and start order,
  • what should happen when the resource starts.

8. Verify the resource is actually being discovered

Sometimes the Lua is fine but FXServer never sees the resource you are trying to start. Open the resources directory and confirm the folder sits under a path that your server scans. Then run refresh in the server console and look for the resource name before running ensure your-resource. If FXServer says the resource cannot be found, fix the directory or folder name before debugging any code. A nested archive such as resources/[local]/my-script/my-script/fxmanifest.lua is a common mistake after extracting downloads.

9. Check configuration values before assuming the framework is broken

Startup failures often come from config that is loaded successfully but contains a value the rest of the resource cannot use. Check job names, item names, database table names, coordinates, feature toggles and locale files. Compare custom values with the names registered by your current QBCore build. If the script expects a job called police but your server renamed it, the failure may look like a framework problem even though the mismatch is local to the resource.

10. Test exports and events one dependency at a time

If the console mentions a missing export, do not replace every integration at once. First confirm the dependency is started and that the export name exists in the version you installed. Then search the resource for the exact export or event call and compare it with the dependency documentation. Libraries change over time, and older scripts can call functions that were renamed or removed. One verified dependency at a time gives you a much cleaner diagnosis than changing several files together.

11. Separate server-side failures from client-side failures

A resource can start on the server while still failing for players. Watch both the FXServer console and the in-game F8 console. Server errors usually involve manifests, database queries, server exports or callbacks. Client errors are more likely to involve UI files, client exports, missing assets, nil player data or code that runs before the player is ready. Knowing which side fails prevents you from editing the wrong file.

12. Check database readiness when the resource starts

Resources that query MySQL during startup can fail if the database library is missing, starts too late, or the expected table does not exist. Confirm your database resource starts before the custom script, then verify the connection is healthy and any required SQL migration has been applied. Avoid repeatedly restarting a script that is failing on the same missing table: fix the schema first, then restart and read the first fresh error.

13. Build a minimal reproduction before rewriting the resource

If the cause is still unclear, copy the resource to a private test server and remove optional integrations until only the smallest failing path remains. Keep the same manifest and one failing feature, then test again. This tells you whether the problem belongs to the resource itself, another dependency, your server configuration or production-only data. A minimal reproduction also makes AI debugging safer because you can provide the relevant files without dumping unrelated private server content.

14. Use a repeatable restart checklist

After each change, save the file, restart only the affected resource when possible, and read the first new error. Do not stack five untested edits together. Keep a short note of what changed and whether the error moved. If the first error changes, that is useful evidence that the previous fix worked. If it stays identical, revert speculative changes and inspect the exact line, dependency or config value the error references.

Fast startup checklist
  • Run refresh and confirm FXServer discovers the resource.
  • Confirm fxmanifest.lua paths and dependency order.
  • Start QBCore, ox_lib and database resources before dependent scripts.
  • Read the first server or F8 error, not the last cascade message.
  • Check renamed jobs, items, exports and events against your installed versions.
  • Test one change at a time on a private server.

Related guides

Want it fixed for you? The £99 Priority Script Fix is a one-off fix for a FiveM or Roblox script. Memberships start at £8 a month on the plans page.

Related tools: QBCore script generator · Fix a FiveM Lua error · all script generators