I'm trying to build a chess application where you can play vs stockfish. I tried implementing stockfish with stockfish.js
(github link) but I couldn't get it to work. I tried the following approaches:
- Add stockfish to public folder and enable it in my index.html (With and without %PUBLIC_URL% and type):
When i tried using (window as any).STOCKFISH()
it still did not work.
- Add stockfish to public folder and use a webworker:
This got the following error: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f I found out that 3c 21 44 4f means <!DO so that it probably can't find it.
- Simply require it (
var stockfish = require("stockfish")
)
This didn't work neither.
I'm doing something wrong and it would be great if someone could help me with implementing this. Thanks in advance