Uncaught TypeError: undefined is not a function

Hi, I have 2 questions:

The first one: When I deploy my project and encrypt my files, as soon as I go to my first scene (after a cinematic video), I get this error just when I'm about to see some text from the NPC:

"Uncaught TypeError: undefined is not a function"

This only happens when I encrypt my files, otherwise it's fine, but since I want to encrypt my project, it's an issue.


The second thing: I have this weather plugin from Moghunter but when I encrypt my project, RPG Maker MV doesn't encrypt the "weather" folder nor includes it in the deployed folder, is there a way to do it other than manually?


Let me know what you need in order to see the problem!

AP
Undefined is not a function can have a million causes. Edit your core script files, namely add
nw.Window.get().openDevTools() line at the end of any of them and show the console output as well as plugins list.
As for your second question, there's no legal way to do it other than manually. MV's EULA forbids any kind of reverse engineering of the editor and that includes its resource encryption algorithms, so an automated encryption software that encrypts other folders cannot legally be created.
If you are using the Exclude Unused Resources when you deploy, it will exclude everything that's not used in the database or event commands. It doesn't look to see what might be used by plugins.

You can sometimes get around this by creating a "dummy" map that'll never be visited, and using images in events or event commands. But this requires that they be saved in the default folders for that type of resource. Not an option in this case.

You can not use the Exclude Unused Files option when you deploy - that should bring over the resources used by the plugin, and every other resource that you're not using in your game as well.

MV does provide a way for plugin creators to highlight resources used by the plugin, so they'll be included in any builds even if the Exclude Unused Resources option is selected. But this requires that the plugin authors use the facility, and I suspect a lot probably don't.
Update:

I encrypted ONLY the Images of my game but not the audio, the game seems to work fine, don't know why, but I'm totally ok with it for now 😀.

Original thread: https://forums.rpgmakerweb.com/threads/uncaught-typeerror-undefined-is-not-a-function.103675/