How do I resolve 'TypeError: Cannot read property 'expParams' of undefined'

When I try to playtest my game, I immediately get the error message "'TypeError: Cannot read property 'expParams' of undefined' ".

The console gives me the following:
rmmz_managers.js:2030 TypeError: Cannot read property 'expParams' of null at Game_Actor.expForLevel (rmmz_objects.js:4151) at Game_Actor.currentLevelExp (rmmz_objects.js:4171) at Game_Actor.initExp (rmmz_objects.js:4163) at Game_Actor.setup (rmmz_objects.js:4066) at Game_Actor.initialize (rmmz_objects.js:4033) at new Game_Actor (rmmz_objects.js:4018) at Game_Actors.actor (rmmz_objects.js:5224) at Game_Party.setupStartingMembers (rmmz_objects.js:5495) at Function.DataManager.setupNewGame (rmmz_managers.js:256) at Scene_Boot.startNormalGame (rmmz_scenes.js:339) SceneManager.catchNormalError @ rmmz_managers.js:2030

How can I resolve this problem?

Thanks in advance.
Did you by chance delete all of the Actors, or do you still have at least one set up in System -> Actors?
basically any "of undefined" means that the system has a reference to something that no longer exists, usually because you deleted it (less likely because a plugin points to a wrong configuration).

in the case of "expParams" that usually is either an actor or a class - for example if you deletze classes and have an actor that still uses one of the deleted classes, or delete an actor that is still referenced in the game or something like that.
Did you by chance delete all of the Actors, or do you still have at least one set up in System -> Actors?
I have one actor set up:
Screen Shot 2021-07-27 at 21.37.59.png

Screen Shot 2021-07-27 at 21.38.47.png

basically any "of undefined" means that the system has a reference to something that no longer exists, usually because you deleted it (less likely because a plugin points to a wrong configuration).

in the case of "expParams" that usually is either an actor or a class - for example if you deletze classes and have an actor that still uses one of the deleted classes, or delete an actor that is still referenced in the game or something like that.
I can't really find any references to nonexistent Database entries though.

The Classes-section looks fine:
Screen Shot 2021-07-27 at 21.40.21.png
in the system 1 tab of the database, when you click below the actor "test", how many lines can you click on and mark, and how many lines don't get marked when clicked?
in the system 1 tab of the database, when you click below the actor "test", how many lines can you click on and mark, and how many lines don't get marked when clicked?
I have only one actor in the Starting Party-box, and only one line is selectable in addition to that:

Screen Shot 2021-07-27 at 23.14.27.png


This is normal however, since double-clicking on the empty line below your actor is how you add additional actors.

No lines beyond these ones are clickable.
No lines beyond these ones are clickable.
yes, that is correct - but originally there were four actors, and if you delete the actor in the actor tab before removing them here, those three more actors become invisible references that can be clicked.
and that was my first idea as to where the reference that is causing the error came from.

still the error trace says that the engine cannot load the experience formula for an actor.
the experience settings are in the class of the actor.
so one part of the following sequence is somehow missing:

- experience data for a class
- class data for an actor
- actor data

The only thing you can do now is recreate that data until the error goes away.
then you'll know which part is missing and can continue looking for the reference
1) create actor 2-4, name them a,b,c and test.
error goes away? check starting party and anything that might use an actor.
error still there? create classes 2-4 and assign them to the new actors, test.
error still there? check the experience curves for all classes and anything that references them.
"Cannot read property expParams of null"

......and, who is this 'null'?
that should be your first question.

find the line calling to expParams, and IT should be tied to another expression that'd usually return an actor.
in this case, I guess, game_party[something].
if you have only one actor, and the code calls for game_party[something-greater-than-1], then game_party[inexistent-slot] is returning null.
and there's your culprit.

that's *debugging*: identify, retrace, and repair.
Put names in your first 8 actor slots, then check the System tab again. If you see any that you don't want there, delete them from the system tab first.

At what point does this happen? When you first launch the game? When you choose New Game or Continue? When you enter a battle? When you open the menu?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-resolve-typeerror-cannot-read-property-expparams-of-undefined.139001/