MV Yanfly Item Upgrade Slots notetag clarification help?

I'm certain I must be doing something wrong and this isn't a bug, but when trying to use Item Upgrade Slots 'string' notetag, TypeError: item.types.contain is not a function appears immediately when the testplay launches. The following is a quote from the help file explaining this notetag:

<Upgrade Item Type: string>
This makes it so this item can be used to upgrade the item that matches
either the item type or the item occassion. If none of those work for you,
you can use the following notetag and place an instance for 'string'
inside of the item upgrade types.

<Type: string>
Puts this type into the notebox for items (not weapons nor armors) and it
will add 'string' as its type. You can insert multiple copies of this
notetag to enable the item to have more types. Any types in here that
match the types for the previous notetag will enable the item to be
upgradeable by that upgrade item type.


The help file repeatedly refers to both items and weapons/armors as "item" interchangeably which is already quite confusing, but in this instance, it is unclear whether 'string' is meant to be replaced with unique terms, or refers to a 'string' of existing terms--which seems redundant as there doesn't appear to be a limitation on notetag specifications. What exactly does "insert multiple copies" mean here? And why does this exist only for items upgrading other items? Is there no way to use it to limit which weapons/armor can have the upgrade applied based on matching notetags? I have tried so many combinations but they all cause the same error.

The demonstration video only shows the gameplay, not how to actually apply this notetag, and there is no example anywhere at all either. It feels like it was written for people who are already familiar enough with JS to understand how it works at a glance, and would therefore not benefit from a help file that goes into just enough detail to not actually explain unfamiliar terms to those needing the help.

I've tried rearranging the Equip/Item core plugins under the main Yanfly Core, but nothing seems to work. The error persists in a blank project with just Core, Item core, Equip core, and Upgrade Slots as well.

In addition to the screenshots below (which is for the purpose of showing how I had the notetags applied, not necessarily their contents) I have attempted to use 'string's such as <Upgrade Item Type: Key, Battle> (with and without commas) or <Type: flower> where the text 'flower' is present in multiple item names and descriptions. Nothing seems to work. If anyone could advise me on how this 'string' tag is meant to be applied, I would be grateful...

Spoiler: Error/Item entries
rmmverr1.png
rmmvex1.png
rmmvex2.png
The error "is not a function" indicates a typo in JavaScript.

Common causes are:
- you have an actual JavaScript typo, either in a notetag or plugin parameter that evaluates code

- you installed/changed plugins or database settings and tried to load a save game instead of starting a new play test

- your Yanfly plugins are not in the correct, listed order from the Yanfly Engine Plugins Web site

Note, that "string" just means a series of characters (as opposed to numbers). The instructions are saying you can make up any words you want, not that you need to actually use the word "string" - but it shouldn't cause any problems to do so.
- I have not edited the js (and I assume a typo in a major plugin would've been caught by now? but I can check more extensively anyway if you can tell me what to look for as "wrong") and as you can see from my screenshot, no typos in my tags.

- I don't have a save game, I always start a new file because I'm only at a stage of testing minor things. My game is not strictly linear either.

- "correct" order is where things get murky; the site itself lists all the core plugins, then all the battle ones, then item and so on, but multiple sources I've seen on this forum have advised people to put the cores first, or in specific orders different than the site, so I'm unsure which is accurate. As I said, I did rearrange them in both of those styles, but if there's a specific placement not mentioned anywhere regarding the series order, please let me know.

Edit: not sure if this is the relevant bit, but it's all that comes up for item.types.contain

JavaScript:
DataManager.processUpgradeNotetags = function(item) {
    var note1 = /<(?:TYPE|TYPES):[ ](.*)>/i;
    var notedata = item.note.split(/[\r\n]+/);

    item.types = item.types || ['ALL'];

    if (item.itypeId === 1) item.types.push('REGULAR');
    if (item.itypeId === 2) item.types.push('KEY');
    if (item.itypeId === 3) item.types.push('HIDDEN A');
    if (item.itypeId === 4) item.types.push('HIDDEN B');
    if (item.occasion === 0) item.types.push('ALWAYS');
    if (item.occasion === 1) item.types.push('BATTLE');
    if (item.occasion === 2) item.types.push('MENU');
    if (item.occasion === 3) item.types.push('NEVER');

    for (var i = 0; i < notedata.length; i++) {
      var line = notedata[i];
      if (line.match(note1)) {
        var str = String(RegExp.$1).toUpperCase();
        if (!item.types.contain(str)) item.types.push(str);
      }
    }
};
multiple sources I've seen on this forum have advised people to put the cores first, or in specific orders different than the site, so I'm unsure which is accurate.
I don't know what sources you've seen on this forum that say differently, but what you describe for the site doesn't sound correct.

If you Google the words I typed, you get the Yanfly Engine Plugins Web site which is the definitive order provided by Yanfly for the plugins to be in your plugin manager in order to ensure proper functionality.

I suggest you double check that, rearrange as necessary, save your project, then start a new save, see if you get the error.

- I have not edited the js
I didn't mean to imply you had. As I said, such typos would frequently be in notetags or plugin parameters that accept JavaScript, not because you actually altered the plugin file itself.

The erroneous JavaScript doesn't necessarily have to do with this specific plugin, a mistake in a notetag or parameter in one place can "bleed over" and cause the error to actually be reported in a different file.

But if you don't have anyplace where you've put JS, then you don't.

The other basic piece of troubleshooting would be to turn off all plugins except the ones required for these notetags to work - e.g. Item Core and Upgrade Slots.
I don't know what sources you've seen on this forum that say differently, but what you describe for the site doesn't sound correct.
I don't mean saying to put them in the wrong order, I just mean I've come across instances where someone corrects the order of a person's plugins, so I make sure to correct mine, and then a different user on a different post says something to the contrary. They might be mistaken, but I have no way of knowing unless someone corrects them. So to be clear, it is correct to have it listed exactly as on the site, for each type? Not YEP Core, Item Core, Equip Core, and then subsequent plugins according to the site's listing for each core type?

I didn't mean to imply you had. As I said, such typos would frequently be in notetags or plugin parameters that accept JavaScript, not because you actually altered the plugin file itself.

Oh I didn't think you were implying it, I was just trying to give my responses in the same format as your list to make it easier to rule them out. Like answering as opposed to deflecting allegations, haha.

I edited my other comment with the relevant script to avoid double posting in case it makes a difference too.
So to be clear, it is correct to have it listed exactly as on the site, for each type? Not YEP Core, Item Core, Equip Core, and then subsequent plugins according to the site's listing for each core type?
Yes. That is the purpose of that page I linked you to, to give you the order the plugins should be installed. And that's what you should see if you look at any of the snatches of plugin manager in the tutorial videos from Yanfly.
Yes. That is the purpose of that page I linked you to, to give you the order the plugins should be installed. And that's what you should see if you look at any of the snatches of plugin manager in the tutorial videos from Yanfly.
Sorry for the delay, I was on my way out the door earlier and just got home. I have arranged the plugins exactly as listed on the Yanfly engine page, but unfortunately the error still persists. What should I be looking for now, something within the js file? Does anything in the script I posted before look out of place?

I'm not sure if it's related, but when combined with WeaponArmorTypeExtend by triacontane, Yanfly's upgrade is not parsing that plugin's notetag which should be adding an additional type to weapons with the tag. I know it could be just a compatibility issue (like if one refers to the game data and the other only modifies it through notetags that the first can't access) but on the off chance it is connected, I figured it would be worth mentioning.
Have you done basic troubleshooting like I described earlier? A new game with only the Item Core and Upgrade Slots enabled?

You need to do something to narrow down the cause of the problem, because by default just having those plugins in a new project does not create an error.

So try with just those two plugins. If you get an error, copy the plugins into a new project. If you still get an error, it's possible something is corrupted in the plugin files and you should re-download them. Otherwise, it's something wrong in your project itself.
Have you done basic troubleshooting like I described earlier? A new game with only the Item Core and Upgrade Slots enabled?

You need to do something to narrow down the cause of the problem, because by default just having those plugins in a new project does not create an error.

So try with just those two plugins. If you get an error, copy the plugins into a new project. If you still get an error, it's possible something is corrupted in the plugin files and you should re-download them. Otherwise, it's something wrong in your project itself.
As I said in my OP, yes, the error still exists in a blank project using only Yanfly Core, Item Core, and Item Upgrade Slot.

I just tried deleting them and redownloading the free essentials pack (which contains both Item and Upgrade) and they still cause the crash in the test project when attempting to use 'string' related tags. I don't think this is a problem with my game or anything if it's occurring in a fresh downloaded file on a blank game, inserting the tags exactly as advertised, copy and pasted from the help file. What should I try next?
that might actually be an error with the file

the version of the plugin i have from the paid pack is 1.10 and the line that would be throwing the error uses the contains function
the one i just downloaded from the free pack is the same version, but that same line uses contain and is the only line to use it without the s

open up the plugin, add an "s" to the end of the word "contain" on line 320, and see if that does anything for you
that might actually be an error with the file

the version of the plugin i have from the paid pack is 1.10 and the line throwing the error uses the the contains function
the one i just downloaded from the free pack is the same version, but that line uses contain and is the only line to use it without the s

open up the plugin, add an "s" to the end of the word "contain" on line 320, and see if that does anything for you
Oh my god this fixed it! Thank you so much, I can't believe it was so simple... but how did this happen? If you download the free essentials pack right now, it will say if (!item.types.contain(str)) item.types.push(str); on line 320... anyone know Yanfly well enough to pass this along? I can't imagine how only the bundle version got corrected.
Good call, @Robro33 - I didn't read carefully enough to notice the missing "S".

@emogal The Yanfly Web site has instructions for reporting bugs (I believe it's a Gmail address), but I've never seen a response to anything submitted that way.
This is just a further discovery, the help file says to put <Type: string> on "items (not weapons nor armors)" which seemed odd to me that items would be for upgrading other items only, so I for the hell of it tried using it on a weapon and it does indeed change the weapon (or armor) type as desired, allow them to be upgraded by those <Upgrade Item Types: string> tagged items. So...not sure why it specifically says it's not for that. But I wanted to add this to the thread before closing in case the 'contains' typo doesn't get fixed, and someone else ends up as confused as I was. I hope they find this thread and it helps them too!
This thread is closed due to being report as solved. If you need it reopened, let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-item-upgrade-slots-notetag-clarification-help.167943/