Closed Toktik closed 6 years ago
Is there anyway you could provide the object your passing to Game
? It would help add context to the error.
Please add repro steps, or provide your code.
The multiplayer examples utilizing the server seem to work. I've manually deleted _nodemodules and dist, merged latest, ran npm i and then npm run examples. Maybe I've missed something, the command is showing that the dev server is using 0.21.5
.
The code in question fetches the phase
from the phase map, and calls allowedMoves
on it. allowedMoves
is guaranteed to be a function as per that code. Looks like the problem is somewhere in either the phase config or the phase code.
Here is the code: https://pastebin.com/a8U4fTBs
I observe that the canMakeMove() is called twice. First time phaseMap
contains default
phase only (not sure what it is), and it throws an error, because there is no ctx.phase
in phaseMap
. Second time it contains all my phases.
Weird. The default phase is only used if no phases
is passed to the flow. Since the code passes one, you should not see it at all.
Thanks for the code, I'm trying to somehow repro your scenario with it, atm to no avail. Could you share a complete example that demonstrates the issue?
Closing this for now. @Toktik Feel free to ask at https://gitter.im/boardgame-io/General if you continue to have any problems.
It happens when doing any move. Using 0.21.5.