You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having ditto on a team can cause the error below sometimes.
TypeError: Cannot read properties of undefined (reading 'types')
at Pokemon.copyTypesFrom (/home/ubuntu/dev/ps/ps-env/node_modules/@pkmn/client/build/index.js:1402:82)
at Handler.|-transform| (/home/ubuntu/dev/ps/ps-env/node_modules/@pkmn/client/build/index.js:708:10)
at Battle2.add (/home/ubuntu/dev/ps/ps-env/node_modules/@pkmn/client/build/index.js:1839:24)
Hi! The issue here is that Greninja does not actually exist in Generation 9 (yay Dexit!) so Ditto doesn't know what to copy types from. You need to change the exists function (second argument to the Generations constructor) in order to include unconventional Pokémon.
(ie, a very lazy exists function) then no error gets thrown.
Pokémon Showdown does not adhere to cartridge legality for some (most?) of its formats, so you will likely need to remember to customize the exists function if you are using @pkmn/data to interop Pokémon Showdown
Having ditto on a team can cause the error below sometimes.
Here's a repro
The text was updated successfully, but these errors were encountered: