-
Notifications
You must be signed in to change notification settings - Fork 44
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
PGN crashes viewer #457
Comments
Well, the notation is just wrong. I cannot say how that was produced. The wrong move is Bc6. This is part of a variant (starting with character "("), which indicates that this move replaces the previous move in the main variation. And that is just wrong. Last move was Qe7 (white), first move of a variation of this should be from white again. Just remove the parentheses before Bc6 and after "finish}" and it should work. |
I've asked my user a bit more about this, and I suspect that they may have manually edited the PGN to add those parenthesis, because I got access to their Chess.com analysis and it isn't present there. They say they didn't add the parenthesis, but I'm not sure how else it would have appeared. Regardless, it would be nice if the viewer either rendered an error message or handled it like lichess does (lichess just dropped off the invalid variation but kept the rest of the game). |
Ok, this sounds reasonable. Something like:
|
@mliebelt Hello, I have another PGN that crashes the viewer. See a codesandbox demonstrating the crash here: https://codesandbox.io/s/pgn-viewer-error-7g2gyf?file=/src/App.js Here is a link to the PGN in a lichess study: https://lichess.org/study/lIKRjbVE/QygmnUCl And finally, here is the raw PGN:
|
In my opinion, this is a bug of Lichess. It is just not a valid notation to have the main line (continuation not played, but not a variant) written down as variant. I tried to create a study and import there your PGN, but the final variation is just ignored when being imported. Could you please copy your study, remove whatever you want, make the study public and insert the link here? I would like to see that, because I am not able to create it. Ok, played around a little bit, found the menu entry "Force variation", which gives you what you have. But really, that is not valid PGN, even if Lichess supports that. When I export that game then, the variation is omitted. Really strange behavior :-( Here is the link to my study: https://lichess.org/study/5lEABhpR#Hc1eQeGh I tend to just close that issue, because it is not a useful behavior ... |
Yeah, I just tested exporting and then reimporting the same study into Lichess and it changes it from a forced variation to the mainline. That is really weird behavior, and I can understand not supporting it in this case. I was able to get a workaround where the viewer doesn't crash and it just drops off the incorrect variation anyway. Feel free to close this issue if you think there aren't any changes to make |
I tried the above PGN as well on Lichess, and I have inconsistent behavior there (don't know why):
Both is not what the user would expect. I tried it then in the configuration builder and got then the following error (which I think is the correct one):
|
So we have 2 options here in that case:
In my opinion, the second is a good idea, but I don't know if it is "easy enough" to implement it. Therefore leave the ticket open. |
I try to display the following PGN (which was generated by Chess.com) in the viewer:
This causes the PgnViewer to crash with the error
Uncaught TypeError: g is undefined
. Here is the same PGN loaded into a lichess study: https://lichess.org/study/PG1EK14j/zVQH4ISqThe text was updated successfully, but these errors were encountered: