Closed rosenfeld closed 3 years ago
Hey, thanks for using it and sorry for late response.
Regarding your snippet, Stockfish
is not a class but just a function returning promise, so something like this should work instead.
fetch('./stockfish.wasm')
.then(r => r.arrayBuffer())
.then(b => Stockfish({ wasmBinary: b }))
.then(stockfish => stockfish.postMessage('uci'))
I tried this code from chrome devtool console on this page https://stockfish-nnue-js.vercel.app and it worked for me.
Thank you! I guess I'm too used to using classes, sorry for that haha
Hi, I'm trying to get it to work locally so that I could build a tool that would identify the critical moments from a game imported from PGN but I'm having a hard time figuring out how to set it up.
I've copied stockfish.js, stockfish.worker.js and stockfish.wasm locally and used this to try to initialize Stockfish:
Then I get this error:
The data passed to
onmessage
looks like this:The code expects urlOrBlob not to be undefined. What am I missing, please?
Thanks for this project by the way!