cannot resume dead coroutine
Something tried to continue a job that had already finished or already crashed. There is nearly always a REAL error above this one.
Do this first
Scroll up and fix the error above this line; this usually disappears with it.
What it means
Something tried to continue a coroutine that has already finished or has already errored. In FiveM this is almost always the runtime reporting a knock-on effect: the coroutine died because of an error inside it, and this is the SECOND message.
What causes it
Ordered by how often it is the answer.
- 1
An earlier error killed the coroutine
Scroll up. There is a real error above this one, and it is the one to fix.
- 2
A callback stored and called twice
An oxmysql or ox_lib callback invoked a second time — the first resume finished it, the second finds it dead.
- 3
Awaiting inside a handler that already returned
MySQL.query.awaitinside a callback whose parent has completed. - 4
Yielding outside a thread
Wait()at file scope, or inside a plain function called from a non-thread context. FiveM reports "attempt to yield from outside a coroutine".
How to tell which one is yours
Look at what is ABOVE this line in the console. If there is any other error, fix that one first and this usually disappears with it. If this is the only message, you are yielding somewhere that has no coroutine.
Where to look
The trace under this message, and the error above it.
How to fix it
Anything that waits must be inside a thread:
-- wrong: Wait at file scope
Wait(1000)
-- right
CreateThread(function()
Wait(1000)
end)Callbacks fire once — guard against a double call:
local done = false
someLib.request(function(result)
if done then return end
done = true
end)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