I tried working with stockfish.js and I have this one problem. I also used @ninjapixel/chess for easier methods than the original.
stockfish.js
@ninjapixel/chess
methods