Quantcast Deferred XML Node object named <name> already exists - WoWInterface
Thread Tools Display Modes
06-30-18, 07:14 AM   #1
LanceDH
An Aku'mai Servant
 
LanceDH's Avatar
Join Date: Aug 2012
Posts: 31
Deferred XML Node object named <name> already exists

I've just started updating my second addon on the beta client, and I'm running into an error about XML nodes with the same name already existing.
Because using Blizzard's dropdown menu code causes taint, I've been using a copy of the code in my addons to replicate the official dropdowns.
This has always worked just fine, but now it seems the client throws a warning because I have multiple addons creating the same XML frames.
I've tried switching over to someone else's lib, but no luck there.
Everything works just fine. It's just the warning that's annoying and I'd want to get rid of.

Example of one of the warnings:
Code:
Message: Deferred XML Node object named MSA_DropDownMenuButtonTemplate already exists
  Reply With Quote
06-30-18, 08:07 AM   #2
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
It's a thing with libs in BfA, I guess. With dozens of addons all having the same libs included and all loading them, they used to ignore it, and now they throw an error.
You'd have to have the lib loaded as its own addon, and not have them included in the other addons anymore. Then only one instance of it exists and loads.
I'd also recommend adding a ! at the front of its name, to hopefully ensure it will load before any of your other addons.

It's a little bit user-non-friendly, if they don't change that behavior for release, though I guess a restructure of addon managers to have libraries as separate addons + having them automatically downloaded when an addon uses them as dependency could be done. But then I'm not sure how well it would handle addons that rely on older versions of libraries (if all addons work fine even with updated libraries then that's not a problem; I just seem to recall instances where an addon was relying on behavior from an older version of one of its libraries that was changed in an update, or something...)

If I understand the situation correctly, at least...
  Reply With Quote
06-30-18, 08:29 AM   #3
LanceDH
An Aku'mai Servant
 
LanceDH's Avatar
Join Date: Aug 2012
Posts: 31
Sooo, they've made the DropDownMenu issue even more annoying.
I don't know much about libs, so to me the path of least resistance would be to just change the prefix of the lib for every addon.
  Reply With Quote
06-30-18, 08:42 AM   #4
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Not really, that's just a general libs thing. Taking a copy of original blizzard code and loading it as a lib is no different than any user-created library.

As long as you changed the prefix for all frame names and everything then I imagine it'd work, but that seems like a lot of work when you can just drag the library's folder out into AddOns folder and rename it once just so it's at the top of the list.
  Reply With Quote
06-30-18, 08:54 AM   #5
LanceDH
An Aku'mai Servant
 
LanceDH's Avatar
Join Date: Aug 2012
Posts: 31
So what you're saying is:
Create the lib as a separate addon
Give it a name that ensures it's loaded first
Have the actual addons depend on it
Package a copy of this addon with the actual addon
If someone installs 2 of the addons, the lib addon will just be overwritten so there's always just 1

If I'm understanding you correctly.
  Reply With Quote
06-30-18, 09:17 AM   #6
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
In theory. I see issues with that system when it comes to distribution, regarding different addons packaging different versions of the same library which would make that error pop up again (that, and having people download the same library multiple times and overwriting/ignoring feels redundant.)

Ideally, we would stop including libraries within addons, and instruct people to download and maintain them separately, but the average person can't read apparently, and that would cause a lot of headaches.

Alternatively, Blizzard could leave it, and continue allowing the same lib to be contained within multiple addons at once without throwing errors, but I imagine there is a reason why they made that change. If loading the same library multiple times doesn't cause any performance problems then we might as well advocate for them to revert that change.

Last edited by Ammako : 06-30-18 at 09:20 AM.
  Reply With Quote
06-30-18, 09:31 AM   #7
LanceDH
An Aku'mai Servant
 
LanceDH's Avatar
Join Date: Aug 2012
Posts: 31
I'll just wait until we get closer to release to see if they fix it. If not I'm just going to end up creating a lib with a different prefix for every addon. It's luckily just a few seconds to replace all the variable names. I'm just not a fan of having multiple frames and pieces of code that do the exact same thing, but that's just how it'll have to be.
  Reply With Quote
06-30-18, 11:16 AM   #8
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Originally Posted by LanceDH View Post
I'm just not a fan of having multiple frames and pieces of code that do the exact same thing, but that's just how it'll have to be.
That's the idea behind having the library loaded only once as its own addon.
  Reply With Quote
06-30-18, 11:52 PM   #9
AcidWeb
A Theradrim Guardian
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 64
Dropdown libraries are not needed anymore - just use this hack:
https://www.townlong-yak.com/bugs/af...FrameLoadTaint
  Reply With Quote
07-01-18, 12:31 AM   #10
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 908
The issue here isn't specifically targeted at libraries, though that is the main reason you'd see it.

Blizzard had been logging xml and load errors for a while. Things like files not being found and duplicate xml templates. If you go to your Live client you can see these in Logs\FrameXML.log. The difference in BfA is that these are now also being shown in-game as an error.
__________________
Knowledge = Power; Be OP

  Reply With Quote
07-02-18, 01:50 AM   #11
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 60
The new errors (really they are considered "Lua Warnings" by the game) are there to let you know about a potential problem - and as mentioned above they are also not new, just went mostly ignored previously since they were only logged to FrameXML.log. And those errors usually point to a possible problem that might creep up on you down the line.

For this one specifically, you cannot reliable re-declare or version a XML template, so if it ever changes in a future library version, there is no guarantee of it working properly. So in short, avoid any XML content in embedded libraries, because there is no way to properly handle that - never has been, now the game just warns you about that more directly.

If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.
  Reply With Quote
07-02-18, 03:10 AM   #12
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 309
Originally Posted by Nevcairiel View Post
If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.
@p3lim, it's your time to shine!
__________________
  Reply With Quote
07-02-18, 03:22 AM   #13
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,676
Originally Posted by Nevcairiel View Post
If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.
Originally Posted by lightspark View Post
@p3lim, it's your time to shine!
https://github.com/p3lim-wow/LibDropDown

I wrote this library some time ago, it's not fully featured, but it's a Lua implementation of dropdowns from scratch.
Would appreciate feedback and contributions, especially testing.

Last edited by p3lim : 07-02-18 at 04:39 AM.
  Reply With Quote
07-03-18, 06:51 AM   #14
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
You might want to pick a different name, since there is "prior art" - https://www.wowace.com/projects/libdropdown-1-0 - a similar situation is why I used LibQTip instead of LibTooltip back in the day.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
07-03-18, 05:41 PM   #15
LanceDH
An Aku'mai Servant
 
LanceDH's Avatar
Join Date: Aug 2012
Posts: 31
I ended up converting the 8.0.1 version of the UIDropDownMenu into a libstub library, including turning the XML into lua.
Took me a while and still need to iron out a few things, but I'm having it run on 2 addons and it works perfectly. So no more XML errors.
I have to create my dropdowns in lua now rather than XML, but I guess I'll have to live with that.
  Reply With Quote

WoWInterface » PTR » PTR General Discussion » Deferred XML Node object named <name> already exists

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off