<Comment deleted by user>
you got your wish i deleted my posts that would not alter the authors purpose. and moved it to my optional reading place.
https://lichess.org/forum/team-dboings-musings/sigh-nhlsomething-amplified-my-spamming-there-saving-the-furniture-here
So please keep to the main dish. I comply with your worldview of spam, troll, unrelated, and non-sensical. have good life on skates. indoor life, sadly. for all of us. who liked hockey as a doing sport not a watching sport.
you got your wish i deleted my posts that would not alter the authors purpose. and moved it to my optional reading place.
https://lichess.org/forum/team-dboings-musings/sigh-nhlsomething-amplified-my-spamming-there-saving-the-furniture-here
So please keep to the main dish. I comply with your worldview of spam, troll, unrelated, and non-sensical. have good life on skates. indoor life, sadly. for all of us. who liked hockey as a doing sport not a watching sport.
<Comment deleted by user>
I am trying to use stockfish-16.1-single.js and/or stockfish-16.1.js instead of lite version.
I downloaded both corresponding js and wasm files and changed the worker declaration:
const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js");
I use Chrome Version 131.0.6778.86 (Build officiel) (64 bits) and installed (it should be not necessary) "Allow CORS: Access-Control-Allow-Origin" chrome extension.
Any idea why? Thanks.
I am trying to use stockfish-16.1-single.js and/or stockfish-16.1.js instead of lite version.
I downloaded both corresponding js and wasm files and changed the worker declaration:
const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js");
I use Chrome Version 131.0.6778.86 (Build officiel) (64 bits) and installed (it should be not necessary) "Allow CORS: Access-Control-Allow-Origin" chrome extension.
Any idea why? Thanks.
@nuidete did you run the application via npm start?
@nuidete did you run the application via `npm start`?
@NHL_128 Yes. The project runs but bestMove & evaluation give no value.
@NHL_128 Yes. The project runs but bestMove & evaluation give no value.
@nuidete said in #14:
I am trying to use stockfish-16.1-single.js and/or stockfish-16.1.js instead of lite version.
I downloaded both corresponding js and wasm files and changed the worker declaration:
const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js");
I use Chrome Version 131.0.6778.86 (Build officiel) (64 bits) and installed (it should be not necessary) "Allow CORS: Access-Control-Allow-Origin" chrome extension.
Any idea why? Thanks.
Hi @nuidete , I assume the lite version worked for you and the errors are due to using the lite version. I will need to check out and get back to you. Did the CORS extension fix the issue, that sounds strange to me.
I will check this out later to see what the issue could be.
@nuidete said in #14:
> I am trying to use stockfish-16.1-single.js and/or stockfish-16.1.js instead of lite version.
> I downloaded both corresponding js and wasm files and changed the worker declaration:
> const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js");
> I use Chrome Version 131.0.6778.86 (Build officiel) (64 bits) and installed (it should be not necessary) "Allow CORS: Access-Control-Allow-Origin" chrome extension.
> Any idea why? Thanks.
Hi @nuidete , I assume the lite version worked for you and the errors are due to using the lite version. I will need to check out and get back to you. Did the CORS extension fix the issue, that sounds strange to me.
I will check this out later to see what the issue could be.
@HollowLeaf , congrat for this great post!
Cors extension didn't fix the issue.
Just to recap:
-
With const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js") => it works fine.
-
With const stockfishWorker = new Worker("/js/stockfish-16.1.js") &
With const stockfishWorker = new Worker("/js/stockfish-16.1-single.js") => no bestmove, no evaluation.
@HollowLeaf , congrat for this great post!
Cors extension didn't fix the issue.
Just to recap:
1) With const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js") => it works fine.
2) With const stockfishWorker = new Worker("/js/stockfish-16.1.js") &
With const stockfishWorker = new Worker("/js/stockfish-16.1-single.js") => no bestmove, no evaluation.
@nuidete said in #18:
@HollowLeaf , congrat for this great post!
Cors extension didn't fix the issue.
Just to recap:
With const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js") => it works fine.
With const stockfishWorker = new Worker("/js/stockfish-16.1.js") &
With const stockfishWorker = new Worker("/js/stockfish-16.1-single.js") => no bestmove, no evaluation.
I just tried it and it worked for me.
If you are using Chrome, can you check the developer tool to see if the files loaded for you? or if there was any issues reported in the console. Ctrl-Shift-i and then go to Network to see if the files where loaded.
@nuidete said in #18:
> @HollowLeaf , congrat for this great post!
> Cors extension didn't fix the issue.
> Just to recap:
> 1) With const stockfishWorker = new Worker("/js/stockfish-16.1-lite-single.js") => it works fine.
>
> 2) With const stockfishWorker = new Worker("/js/stockfish-16.1.js") &
> With const stockfishWorker = new Worker("/js/stockfish-16.1-single.js") => no bestmove, no evaluation.
@nuidete
I just tried it and it worked for me.
If you are using Chrome, can you check the developer tool to see if the files loaded for you? or if there was any issues reported in the console. Ctrl-Shift-i and then go to Network to see if the files where loaded.
I just tried. The lite-single.js and the single.js work for me, the stockfish-16.1.js does not. I get an error like this:
Uncaught ReferenceError: SharedArrayBuffer is not defined
at e (stockfish-16.1.js:8:4856)
at u (stockfish-16.1.js:8:30466)
at stockfish-16.1.js:8:30883
at stockfish-16.1.js:8:31130
which points to a CORS error, as you two have already figured out. See
https://stackoverflow.com/a/65675390/1658543
which points to
https://stackoverflow.com/a/67200228/1658543
which suggests installing "craco", a configuration wrapper which allows adding settings to unf*** the CORS dev experience.
So I did:
-
Run
npm install --save-dev @craco/craco, as documented here: https://www.npmjs.com/package/@craco/craco. This installs craco. -
Create a
craco.config.jsaside of thepackage.jsonand add the following:
module.exports = {
devServer: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
}
};
- inside the
package.json, in the "scripts" section, replace the calls toreact-scriptswithcraco. The section should then look like this:
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject",
...
},
When I now start the dev server, I see craco start instead of react-scripts start for a short moment. And it works with the stockfish-16.1.js.
@nuidete
I just tried. The lite-single.js and the single.js work for me, the stockfish-16.1.js does not. I get an error like this:
```
Uncaught ReferenceError: SharedArrayBuffer is not defined
at e (stockfish-16.1.js:8:4856)
at u (stockfish-16.1.js:8:30466)
at stockfish-16.1.js:8:30883
at stockfish-16.1.js:8:31130
```
which points to a CORS error, as you two have already figured out. See
https://stackoverflow.com/a/65675390/1658543
which points to
https://stackoverflow.com/a/67200228/1658543
which suggests installing "craco", a configuration wrapper which allows adding settings to unf*** the CORS dev experience.
So I did:
1) Run `npm install --save-dev @craco/craco`, as documented here: https://www.npmjs.com/package/@craco/craco. This installs craco.
2) Create a `craco.config.js` aside of the `package.json` and add the following:
```
module.exports = {
devServer: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
}
};
```
3) inside the `package.json`, in the "scripts" section, replace the calls to `react-scripts` with `craco`. The section should then look like this:
```
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject",
...
},
```
When I now start the dev server, I see `craco start` instead of `react-scripts start` for a short moment. And it works with the stockfish-16.1.js.

