Ok, I know it's a terrible practice, but somebody just reported a "undefined is not a function" error in one of my projects.
I'm not able to replicate the error on my end, it works fine for me and other users, is there some kind of error log he can send me?
I released an early alpha with the "deploy" tool... I understand this doesn't come with a debug feature?
Players cannot help you debug your game in any way, since on deployed version of the game the debug tools are disabled. The only thing they can do is give information.
Dang... it seems to be specific to that player's computer. I really have no idea how I can help him barring sending a playtest version and asking him to send me the error log.
Is there any way I can enable the console somehow?
let him send you a save. See if you are affected too.
What OS does the player have, and what deployment option did you use?
If the player has access to the index.HTML of the game, he should just start that with a regular browser and F8 will work.
1. Ask the player to send you the dump file (enable dumps if not already enabled)
2. Also ask for the output in the event viewer. Should have an entry for each crash and sometimes it's useful.
Other than that you can only instrument the code a bit more in a new version and hope you can catch it.
An 'undefined is not a function' should be able to be replicated. It is to do with scripts/plugins. Perhaps you have done something that the player hasn't done, in order to initialise whatever it wants to look at. You have not followed their steps exactly. The full error message would be helpful, if there is more.
Have you only given players ONE build? Any chance this person had an earlier build and saved a game, then resumed that game when you gave them the latest build? That is one of the major causes of this error message.
My idea would be to write a try/catch in something like Scene_Base's update method and any method that throws an error in that call stack would then be caught by a method lower in the stack (like update). Once caught, then log the exception to the file and players can send you that file with a printed stack trace and what not.
Of course, I tried to play around with this and I couldn't get the exceptions to be caught and from what Google may be telling me is stack unwinding may not be something JavaScript can do. Perhaps someone more familiar with JavaScript's ins and outs could shed light on this? I feel like this approach, in theory at least, would be the best way for players to file bug reports on deployed games.
What is the difference between them downloading nw.js and hacking the core scripts to unlock it?
I think he's saying he hacked the editor, not the core scripts, to see how Test Play allows you to access the debugger.
wouldn't the error be "can't execute function of undefined" instead of "undefined is not a function"?
undefined is neither a function, or a variable, or anything.... it's *undefined*.
of course it's not a function! it shouldn't be able to be called by anything in the first place.
you can't write something like "object.undefined()"
have that playtester send you a screenshot of the error, instead of taking their word for it.