ArneVogel / listudy

Listudy - chess training server
https://listudy.org
GNU Affero General Public License v3.0
292 stars 45 forks source link

SyntaxError at line: 1, character: 1; Unexpected: "" #35

Closed gsingh93 closed 3 years ago

gsingh93 commented 3 years ago

I see 'SyntaxError at line: 1, character: 1; Unexpected: ""' in a red box when I navigate to this study: https://listudy.org/en/studies/3xdxc5-english-symmetrical-four-knights-master.

The console shows two messages:

{
  "message": "Expected \" \", \"*\", \".\", \"0-1\", \"1-0\", \"1/2-1/2\", \";\", \"O-O\", \"O-O-O\", \"[\", \"\\n\", \"\\r\", \"\\t\", \"\\x0C\", \"{\", [1-9], [NKQRB], or [a-h] but \"\" found.",
  "expected": [
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "{",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "{",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": ";",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "[",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "{",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "{",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": ";",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "class",
      "parts": [
        [
          "1",
          "9"
        ]
      ],
      "inverted": false,
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": " ",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\f",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\t",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\r",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "\n",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": ".",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "O-O-O",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "O-O",
      "ignoreCase": false
    },
    {
      "type": "class",
      "parts": [
        "N",
        "K",
        "Q",
        "R",
        "B"
      ],
      "inverted": false,
      "ignoreCase": false
    },
    {
      "type": "class",
      "parts": [
        "N",
        "K",
        "Q",
        "R",
        "B"
      ],
      "inverted": false,
      "ignoreCase": false
    },
    {
      "type": "class",
      "parts": [
        [
          "a",
          "h"
        ]
      ],
      "inverted": false,
      "ignoreCase": false
    },
    {
      "type": "class",
      "parts": [
        [
          "a",
          "h"
        ]
      ],
      "inverted": false,
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "1-0",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "0-1",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "*",
      "ignoreCase": false
    },
    {
      "type": "literal",
      "text": "1/2-1/2",
      "ignoreCase": false
    }
  ],
  "found": "",
  "location": {
    "start": {
      "offset": 0,
      "line": 1,
      "column": 1
    },
    "end": {
      "offset": 1,
      "line": 1,
      "column": 2
    }
  },
  "name": "SyntaxError"
}

and

Uncaught TypeError: trees.map is not a function
    at study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2
    at Module.<anonymous> (study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2)
    at n (study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2)
    at Object.<anonymous> (study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2)
    at n (study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2)
    at study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2
    at study-ec97f0a8f37dab4ffcae9af541bcc2f7.js?vsn=d:2
ArneVogel commented 3 years ago

Fixed with https://github.com/ArneVogel/listudy/commit/e5b7d313bd984b011cc5d058ad41beb3c3c9ed71. Thanks for the report.