In all of the chessjs documentation, const chess = require('chess'); is used.
However, when I try to use this syntax, I get this error:
const Chess = require('chess');
^
Error [ERR_REQUIRE_ESM]: require() of ES Module is not supported.
Instead change the require of main.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> {
code: 'ERR_REQUIRE_ESM'
}
Is there a solution for this?