Need help with load script!

Greetings! I'm trying to use the script to load specific file, but every time i load the save i get this error.
For saving i use this script:
Code:
$gameSystem.setSavefileId(1);
$gameSystem.onBeforeSave();
DataManager.saveGame(1);
And for save loading i use this:
Code:
DataManager.loadGame(1)
  .then(() => {
    SoundManager.playLoad();
    SceneManager._scene.fadeOutAll();
    if ($gameSystem.versionId() !== $dataSystem.versionId) {
      const p = $gamePlayer;
      p.reserveTransfer($gameMap.mapId(), p.x, p.y, p.direction(), 0);
      p.requestMapReload();
    }
    SceneManager.goto(Scene_Map);
    $gameSystem.onAfterLoad();
  }).catch(() => SoundManager.playBuzzer());
I tried to find how to fix this issue on google but found nothing, so the help would be appreciated!
Assuming you haven't solved this problem yet...

The error says it can't read the list property because the specified event page is undefined. It looks like a problem with an Autorun event, possibly the one seen in the background of your screenshot.

Ideas:
  1. Maybe it's an async issue. Does it help if you replace this line:
    JavaScript:
    DataManager.loadGame(1)
    ...with this?
    JavaScript:
    await DataManager.loadGame(1)

  2. Maybe it's related to editor changes since the save was made. Does it work if you trigger the "save" event, then trigger the "load" event, without returning to title or closing the game?

  3. I don't think it's the case for this particular error, but:
    For saving i use this script
    The "save" event will continue processing the rest of its commands after the save is loaded (unless that event is Parallel and the game version changed since the save was made). If those commands include a reference to a character who no longer exists, e.g. because you've deleted an event since making that save, that could cause an error.

  4. Maybe it's due to plugins. Consider sharing screenshot(s) of your Plugin Manager so we can see what plugins you're using and their load order. Loading from the map scene is non-standard: some plugins may require a modified "load" script call to properly initialise their map data.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-load-script.162689/