Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chess.js into client side #405

Closed
AlonsoDo opened this issue May 9, 2023 · 2 comments · Fixed by #406
Closed

chess.js into client side #405

AlonsoDo opened this issue May 9, 2023 · 2 comments · Fixed by #406

Comments

@AlonsoDo
Copy link

AlonsoDo commented May 9, 2023

In a Node.js environment the new 1.0.0 versions of chess.js work fine on the server side.
But how do I make it work on the client side? What are the steps to follow? I can't find documentation.
What about CDN and instance declaration with var chess = new Chess(); .
Is there any other way to do it?

@jhlywa
Copy link
Owner

jhlywa commented May 9, 2023

@AlonsoDo I believe you're running into this issue due to the differences between ESM vs CommonJS more info here. Sorry for the lame answer, but maybe try using a bundler (webpack or rollup)? There are a couple of things I'd like to try to support both environments, but my development time is extremely limited for the next few weeks.

@jhlywa
Copy link
Owner

jhlywa commented May 16, 2023

This issue has been fixed in 1.0.0-beta.6. See the README for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants