2

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:

  1. Add stockfish to public folder and enable it in my index.html (With and without %PUBLIC_URL% and type): img1

When i tried using (window as any).STOCKFISH() it still did not work.

  1. Add stockfish to public folder and use a webworker:

enter image description here

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.

  1. 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

Ties Mulder
  • 83
  • 1
  • 8

0 Answers0