MZ TypeError: Cannot read property 'close' of undefined

Hey! Something of an RPG Maker veteran here with a head-scratcher.
I've been working on a game recently, and seemingly out of nowhere, it started crashing any time I close a text window while playtesting. Attached to this post is the message I get, and a screenshot of what the console looks like.
The issue persists even if I disable and remove all plugins, so it can't be caused by one of them. I had been fiddling around in rmmz_scenes.js to hide the gold window, so I could've accidentally messed something up at that time?
How would I resolve this issue?
Screenshot 2025-05-31 162935.png
Screenshot 2025-05-31 163249.png
If you know you messed your rmmz_scenes.js just copy it from another project (same version). People generally suggest you make changes through the plugin system instead of changing the core files.
and a screenshot of what the console looks like.
your screenshot is NOT of the console - you forgot to switch your developer tools to the console tab on top of it.
If you know you messed your rmmz_scenes.js just copy it from another project (same version). People generally suggest you make changes through the plugin system instead of changing the core files.
Thanks! I did this and it worked without seeming to mess anything else up. I'll figure out another way to hide the gold window ^^

your screenshot is NOT of the console - you forgot to switch your developer tools to the console tab on top of it.
Ah! My mistake
Here's what the console ACTUALLY looks like during the crash:
Screenshot 2025-06-01 110945.png
So terminateMessage is trying to close the gold window, but it does not exist for some reason.

Original thread: https://forums.rpgmakerweb.com/threads/typeerror-cannot-read-property-close-of-undefined.178055/