Scrap (Junk Seller)

Scrap (Junk Seller)

21M Downloads

LUA error on startup

grey-out opened this issue ยท 3 comments

commented

Which software were you running?

  • Addon version name: 10.2.5
  • Client used: Retail today's update 10.2.0.52607

Please describe the bug.
LUA error

Please describe how to reproduce it.

  1. Loading and re-loading game/UI

**Error Log:
33x Scrap/addons/config/tutorials.lua:46: attempt to index field 'Visualizer' (a nil value)
[string "@Scrap/addons/config/tutorials.lua"]:46: in function ?' [string "@BagBrother/libs/WildAddon-1.0-1/WildAddon-1.0.lua"]:20: in function <...dOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:18> [string "@BagBrother/libs/WildAddon-1.0-1/WildAddon-1.0.lua"]:56: in function <...dOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:53> [string "=[C]"]: ? [string "@BagBrother/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:29: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25> [string "@BagBrother/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:64: in function Fire'
[string "@BagBrother/libs/AceEvent-3.0-4/AceEvent-3.0.lua"]:120: in function <BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua:119>
[string "=[C]"]: ?
[string "=[C]"]: in function LoadAddOn' [string "@Scrap/addons/main/main.lua"]:40: in function ?'
[string "@BagBrother/libs/WildAddon-1.0-1/WildAddon-1.0.lua"]:20: in function <...dOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:18>
[string "@BagBrother/libs/WildAddon-1.0-1/WildAddon-1.0.lua"]:56: in function <...dOns/BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:53>
[string "=[C]"]: ?
[string "@BagBrother/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:29: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@BagBrother/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:64: in function Fire' [string "@BagBrother/libs/AceEvent-3.0-4/AceEvent-3.0.lua"]:120: in function <BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua:119> [string "=[C]"]: ? [string "=[C]"]: in function LoadAddOn'
[string "@FrameXML/UIParent.lua"]:542: in function UIParentLoadAddOn' [string "@FrameXML/UIParent.lua"]:681: in function TimeManager_LoadUI'
[string "@FrameXML/UIParent.lua"]:1527: in function <FrameXML/UIParent.lua:1407>
[string "=[C]"]: ?

Locals:
self =

{
SendSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:82
RegisterMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:90
UnregisterMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:153
ResetTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:207
SendMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:59
UnregisterSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:78
Restart = defined @Scrap/addons/config/tutorials.lua:65
RegisterSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:74
UnregisterAllMessages = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:174
TriggerTutorial = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:190
NewModule = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:68
RegisterEvent = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:90
OnEnable = defined @Scrap/addons/config/tutorials.lua:9
GetTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:222
UnregisterAllEvents = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:174
Start = defined @Scrap/addons/config/tutorials.lua:61
RegisterTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:179
UnregisterEvent = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:153
Tag = "SCRAP_"
}
(*temporary) = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:179
(*temporary) =
{
SendSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:82
RegisterMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:90
UnregisterMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:153
ResetTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:207
SendMessage = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:59
UnregisterSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:78
Restart = defined @Scrap/addons/config/tutorials.lua:65
RegisterSignal = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:74
UnregisterAllMessages = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:174
TriggerTutorial = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:190
NewModule = defined @BagBrother/libs/WildAddon-1.0/WildAddon-1.0.lua:68
RegisterEvent = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:90
OnEnable = defined @Scrap/addons/config/tutorials.lua:9
GetTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:222
UnregisterAllEvents = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:174
Start = defined @Scrap/addons/config/tutorials.lua:61
RegisterTutorials = defined @Scrap/libs/CustomTutorials-2.1/CustomTutorials-2.1.lua:179
UnregisterEvent = defined @BagBrother/libs/CallbackHandler-1.0/CallbackHa

commented

not sure this is a proper fix but if you change Scrap/addons/config/tutorials.lua line 46 to:
shine = Scrap.Visualizer and Scrap.Visualizer.ParentTab or MainMenuBarBackpackButton,

the addon loads again.

commented

@Jaliborc not sure if this was added by accident or a part of another plugin but searching this addon code Scrap.Visualizer is not anywhere else.

commented

@Jaliborc

Acctually it looks like you have this addon seperated into 3 parts but in this same git. The problem is Scrap.Visualizer get loaded by Scrap_Merchant. For this to work you need to add Scrap_Merchant to OptionalDeps in any toc that uses Scrap_Merchant. This makes the game load Scrap_Merchant

Once this is fixed it does however lead to a different error:
/AddOns/Scrap/addons/merchant/visualizer.lua:6: attempt to index global 'Scrap' (a nil value)

The issue is the ordering of how parts of your addon get loaded. Normally with just one added you would first add in your case mains/main.xml then add merchant/merchant.xml

However parts of your code depend on other parts that are not loaded, you would have to rework your addon code to get this to work properly. Or I guess just go with my other tutorials.lua fix. Not sure Scrap.Visualizer.ParentTab is. If that acctually works or not.