[FIXED] this.clearCommandList is not a function

I'm trying to create a window in a new scene but it is throwing an error when calling HorzCommand (Window_Command)'s initialize.

The error log
Code:
Window_Command.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_windows.js:1300:5
Window_HorzCommand.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_windows.js:1454:5
Window_ForgeCommand.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:111:2
Window_ForgeCommand@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:101:2
Scene_Forge.prototype.createForgeCommandWindow@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:72:23
Scene_Forge.prototype.create@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:65:2
SceneManager.changeScene@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:2005:13
SceneManager.updateMain@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:1982:13
SceneManager.update@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:1907:9

My window's class
Code:
function Window_ForgeCommand() {
	this.initialize.apply(this, arguments);
}

Window_ForgeCommand.prototype = Object.create(Window_HorzCommand.prototype);
Window_ForgeCommand.prototype.constructor = Window_ForgeCommand;

Window_ForgeCommand.prototype.initialize = (width, cantForge, cantDismantle) => {	
	this.windowWidth = width;
	this.cantForge = cantForge;
	this.cantDismantle = cantDismantle;
	Window_HorzCommand.prototype.initialize.call(this, 0, 0);
}

Window_ForgeCommand.prototype.windowWidth = () => this.windowWidth ;
Window_ForgeCommand.prototype.maxCols = () => 3;
Window_ForgeCommand.prototype.makeCommandList = () => {
	this.addCommand(Forge.forgeWindowName, 'forge', !this.cantForge);
	this.addCommand(Forge.dismantleWindowName, 'dismantle', !this.cantDismantle);
	this.addCommand(TextManager.cancel, 'cancel');
}

I'm new to scripting in RPGMMV, sorry if it's a dumb problem.
It would be much more convenient to see the full error log, because from what you sent I can't see the exception that got fired.

edit: Nevermind, the title says it. Nevertheless, the error looks weird, have you done something to the horzcommand window itself or command window?
It would be much more convenient to see the full error log, because from what you sent I can't see the exception that got fired.

edit: Nevermind, the title says it. Nevertheless, the error looks weird, have you done something to the horzcommand window itself or command window?
Old answer:
Spoiler
As the title says, the error is that this.clearCommandList isn't a function.

2018-12-03-03-06-57-Window.png


// Edit
And, yes, it is there in rpg_windows.js

image.png

Didn't see your edit.
I didn't change anything in HorzCommand nor Window_Command.
Ouch, microsoft edge!
Is there a specofic reason behind the fact that there's that invalid state error? What if you launch it in the default exe?
Ouch, microsoft edge!
Is there a specofic reason behind the fact that there's that invalid state error? What if you launch it in the default exe?
I'm running it with Firefox.
About the invalid state error, I don't know too. Even with every plugin disabled it is still there.
And I get the same error running from inside the engine, I prefer running in the browser 'cause of documentation access. Personal workflow I'd say.

// Edit:
The state error is thrown when the game starts so I guessed it was "normal" or at least nothing that I need to worry about.
What if you launch it from the normal exe (or normally through rpg maker)? Does it work?
What if you launch it from the normal exe (or normally through rpg maker)? Does it work?
Nope, exactly same error, including the invalid state error.

// Edit
Printing the Window_Command class I can see the clearCommandList function
image.png

Any clues?
Looks like something is interfering with the way default horzcommand works.
What if you just define the function manually imside your window via copy pasting?
Looks like something is interfering with the way default horzcommand works.
What if you just define the function manually imside your window via copy pasting?
Nope.
Tried defining the clearCommandList function both for the Window_Command and for my window's class and through the console, neither worked.
Can you test my code there to see if it's something with the base RMMV's files?
I am currently en route to a 12 hours long work shift. That means about 13 hours until I can look. But if it doesn't get solved by then, I will see
I am currently en route to a 12 hours long work shift. That means about 13 hours until I can look. But if it doesn't get solved by then, I will see
Sure, thank you o/
FIXED.
To be honest it was a really dumb problem, I was just tilted.
You can't use arrow functions for those object functions because arrow function doesn't have it's own this.
Anyway, thank you @Poryg.
Haha, didn't know 😀

Anyway, now that we know, you can always rewrite it to proper ES6 class syntax 😛

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/fixed-this-clearcommandlist-is-not-a-function.102884/