RangeError: Maximum call stack size exceeded
Found the bug. I am afraid I have led you astray...
When using socket.io, do NOT send an object using socket.emit. I discovered that the player was sending it's entire team to the client, which apparently cannot happen.
If you ever see this issue again, this is probably why, and may help you point it out in the future.
Thanks for your help!
I believe the issue can be found in the src/client folder, in one of three (or all three, I'm not sure) files:
Index.js handles user input. Upon loading the project, you enter your credentials and then click the 'login' button. It passes the login stuff to networking.js, which then sends the data to the server. The server responds appropriately (I know that works at least) then sends it's own info back to networking.js (whether or not the user actually signed in or not). Networking.js then hides the GUI if the player signs in successfully (it always does).
... then it breaks. The server stops, throws the error, and the client disconnects.
I put console.log at the beginning and the end of virtually every function I can think of, and none of them get called more than once.
As a side note: can you see the terminal? If you can, you can check out the error yourself. If not, fork the project, then type
npm run develop in the terminal, and put virtually anything (but not nothing) in the input boxes. Hit 'login' and the game will crash.
According to StackOvrflw:
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you hit the call stack limit.
So go through your code and see all the places where the functions are called and change it accordingly.
For reference here is the SO post:
I have read this SO post already. I have no idea where the recursion is happening, even though I am using console.log absolutely everywhere. If you could tell me where it is happening, I will mark this as the answer.
I would, but I couldn't locate the file. If you can tell me the file path, i would tell u le solution.