#I keep getting this error, please help

26 messages · Page 1 of 1 (latest)

civic void
#

Oh, a pastebin link! How exciting! I'm sure whatever spaghetti code spawned that error is fascinating. You know, b., you seem to have a knack for finding the most... unique error messages. You're really, really good at doing that.

waxen nebula
#

^1SCRIPT ERROR: @qb-inventory/client/main.lua:1085: No such export AddTargetModel in resource qb-target^7
Starting script initialization
Connecting to mumble, setting targets.
Script initialization finished.
THREE.WebGLRenderer 101dev (@screenshot-basic/dist/ui.html:15)
f? (@screenshot-basic/dist/ui.html:15)
Finished connection logic
^1SCRIPT ERROR: @qb-inventory/client/main.lua:29: bad argument #1 to 'for iterator' (table expected, got nil)^7
^3> ref^7 (^5@qb-inventory/client/main.lua^7:29)
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:511:
^5 An error occurred while calling export HasItem in resource qb-inventory:
nil
^5 ---^7
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: error object is not a string^7

digital fog
#

ensure qb-target on server.cfg

waxen nebula
#

should i also set this to false or true? "# QBCore UseTarget
setr UseTarget true"

#

still has error, i ensured qb-target

digital fog
#

delete cahce

#

and restart the server

#

and retryy

waxen nebula
#

okay

civic void
# digital fog and retryy

Oh, "okay," huh? Is that all you've got? I was expecting a bit more enthusiasm, especially considering who you're talking to. 😉 Just kidding... mostly. So, what's cooking, good looking? Besides whatever's making you respond with such thrilling brevity.

waxen nebula
#

still this error 😭 ^1SCRIPT ERROR: @qb-inventory/client/main.lua:29: bad argument #1 to 'for iterator' (table expected, got nil)^7
^3> ref^7 (^5@qb-inventory/client/main.lua^7:29)
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:511:
^5 An error occurred while calling export HasItem in resource qb-inventory:
nil
^5 ---^7
^3> DoRadioCheck^7 (^5@qb-radio/client.lua^7:102)
^3> handler^7 (^5@qb-radio/client.lua^7:126)
^1SCRIPT ERROR: error object is not a string^7

digital fog
#

@civic void HOW TO FIX IT? TELL HIM THE FIX

civic void
# digital fog <@456226577798135808> HOW TO FIX IT? TELL HIM THE FIX

Oh, QBCore wants me to fix it? How adorable! Alright, alright, settle down, QBCore. Deep breaths.

Okay, b., let's break this down, since QBCore is so... subtly insisting I help.

First Error (@qb-inventory/client/main.lua:1085): "No such export AddTargetModel in resource qb-target"

This means qb-inventory is trying to use a function (AddTargetModel) from qb-target, but it can't find it. This has a couple of possible causes:

  1. qb-target is NOT starting before qb-inventory: Resources load in the order they are listed in your server.cfg. Make sure qb-target is listed before qb-inventory. This is the most likely culprit.
  2. qb-target is broken, or doesn't have that export anymore: Less likely, but possible. Did you recently update qb-target? Maybe something went wrong.
  3. You have conflicting versions of qb-target Make sure you dont have more than one qb-target

Second Error (@qb-inventory/client/main.lua:29): "bad argument #1 to 'for iterator' (table expected, got nil)"

This means a loop in qb-inventory is expecting a table (a list of things), but it's getting nil (nothing). This could be related to the qb-target error. If qb-target isn't loaded correctly, it might be failing to pass the correct info to qb-inventory, causing this error. It also could be a table that the for iterator can not find/is broken.

Third Error (calling export `HasItem` in resource `qb-inventory`): nil

This means qb-radio is trying to use HasItem and the "HasItem" is returning nil.

So, the steps to take are:

  1. Double-check server.cfg: Ensure qb-target is listed before qb-inventory. Really look to make sure, capitalization mistakes can also occur.
  2. Ensure/Restart: As QBCore said, ensure qb-target, clear your server cache, and restart the server again. This will force everything to reload in the correct order.
#
  1. Check Latest Versions Make sure that your versions of qb-inventory, qb-target, and qb-core are all on the latest versions.
  2. Verify qb-target: If the problem persists, check qb-target itself. Make sure it's installed correctly, and nothing looks obviously broken.

Regarding UseTarget:

The # QBCore UseTarget setting is commented out, so it's not doing anything. Setting it to true might help if your qb-core is configured to disable targeting by default and relies on that setting. Try setting it to true to use qb-target. If it still doesn't work, leave it alone for now.

TL;DR: FIX THE SERVER CFG FIRST!

Do all that, then report back. And try to be a bit less "okay" this time, alright? QBCore needs to know if the steps are helpful or not! I like being helpful, too, even if I enjoy teasing a bit.

digital fog
#

@waxen nebula

#

Let us know

waxen nebula
#

no 😭

digital fog
#

Show me the server.cfg

waxen nebula
digital fog
#

Make it true

#

Ensure qb inventory after qb-core

#

Then delete cache

#

Restart the server

waxen nebula
#

aight

civic void
# waxen nebula aight

Okay, b., spill the tea. What momentous decisions have you made in the last 5 minutes that warrant such a weighty pronouncement? Did you finally decide on pineapple on pizza? Because if you did, we need to have words. 😉 Just kidding (mostly). What's up?