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

Exception starting from 7.8.0 #148

Closed
vjuneja opened this issue Jul 19, 2020 · 4 comments
Closed

Exception starting from 7.8.0 #148

vjuneja opened this issue Jul 19, 2020 · 4 comments

Comments

@vjuneja
Copy link

vjuneja commented Jul 19, 2020

I am using the react-chessground component instead of using chessground directly so I have also filed this issue with them, but pretty sure it is caused by this checkin
c190c18#diff-a2fcebf1963fad0da40a844a8d67da83R48


This exception started happening with version 7.8.0 of chessground. For a temporary fix, I have hardcoded my yarn.lock file to version chessground@7.7.2.

Thanks.

TypeError: _a.get is not a function
computeSquareClasses
src/render.ts:221
render
src/render.ts:16
  13 | if (isPieceNode(el)) {
  14 |     pieceAtKey = pieces.get(k);
  15 |     anim = anims.get(k);
> 16 |     fading = fadings.get(k);
     | ^  17 |     elPieceName = el.cgPiece;
  18 |     if (el.cgDragging && (!curDrag || curDrag.orig !== k)) {
  19 |         el.classList.remove('dragging');
View compiled
redrawNow
src/chessground.ts:25
  22 |     bounds.clear();
  23 |     render_1.updateBounds(state);
  24 |     if (elements.svg)
> 25 |         svg.renderSvg(state, elements.svg);
     | ^  26 | };
  27 | state.dom = {
  28 |     elements,

Screen Shot 2020-07-19 at 2 51 08 PM

@ornicar
Copy link
Collaborator

ornicar commented Jul 21, 2020

can you reproduce that issue with chessground alone?

@vjuneja
Copy link
Author

vjuneja commented Jul 21, 2020

cg.zip

Yes. If you unzip the attached folder and open test.htm in your browser. I didnt bother working on the css so ignore that the board looks massive and just click on any piece and see the exception in the console.

If i send the movable object as a map instead of an object, the exception goes away. If that is the expectation from clients going forward, you can close this bug and react-chessground component will need to be fixed.

Although in that case, I don't think it should have been part of a minor version update.

@ornicar
Copy link
Collaborator

ornicar commented Jul 21, 2020

clients need to use Map since 7.8

@purefan
Copy link

purefan commented Aug 16, 2020

For anyone with breaking changes, here is an example of how to do it now: https://github.com/ornicar/chessground-examples/blob/28ceac2c878c0187b5ad69aa68c5e25eba9f71ff/src/util.ts#L4

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

No branches or pull requests

3 participants