Skip to content

5. Errors

hyeongi-park edited this page Jul 27, 2026 · 1 revision

Errors

ChessBoard-Web.js has an error system designed to inform you when you use the API incorrectly.

Every alert has a unique code associated with it and you can control how the errors are presented with the showErrors config option.

1001 - Empty Element ID

  • Error Text: The first argument to Chessboard() cannot be an empty string.
  • Description: The first argument to the Chessboard() constructor should be the id of a DOM element or a reference to a single DOM element.

1003 - Invalid Element Reference

  • Error Text: The first argument to Chessboard() must be an ID or a single DOM node.
  • Description: The first argument to the Chessboard() constructor should be the id of a DOM element or a reference to a single DOM element.

1005 - Missing or Incompatible jQuery

  • Error Text: Unable to find a valid version of jQuery. Please include jQuery 1.8.3 or higher on the page.
  • Description: Chessboard requires jQuery version 1.8.3 or higher.

1810 - Invalid Square Format for hightlightSquare (New!)

  • Error Text: Invalid value passed to highlightSquare().e4
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1811 - Invalid Square Format for removeHighlight (New!)

  • Error Text: Invalid value passed to removeHighlight().e4
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1812 - Invalid Squares Format for addArrow (New!)

  • Error Text: Invalid values passed to addArrow().{from:e2, to:e4}
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1813 - Invalid Square/Type Format for removeArrow (New!)

  • Error Text: Invalid values passed to removeArrow().{from:e2, to:e4}
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1814 - Invalid Shape Format for addMark (New!)

  • Error Text: Invalid values passed to addMark().{square:square, type:type}
  • Description: Squares must be a string in the form of 'e2', 'b8', etc. / Type must be 'circle', 'cross', or 'square'

1815 - Invalid Square Format for removeMark (New!)

  • Error Text: Invalid values passed to removeMark().e4
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1816 - Invalid Square Format for addNagBadge (New!)

  • Error Text: Invalid value passed to addNagBadge().e4
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

1817 - Invalid Image Format for addNagBadge (New!)

  • Error Text: Invalid image source passed to addNagBadge().brilliant
  • Description: Squares must be a string in the form of 'brilliant', 'mistake', etc.

1818 - Invalid Square Format for removeNagBadge (New!)

  • Error Text: Invalid value passed to removeNagBadge().e4
  • Description: Squares must be a string in the form of 'e2', 'b8', etc.

2826 - Invalid Move Format for move

  • Error Text: Invalid move passed to the move method.
  • Description: Moves must be a string in the form of 'e2-e4', 'b8-c6', etc.

5482 - Invalid Orientation Value

  • Error Text: Invalid value passed to the orientation method.
  • Description: The first argument to the orientation method must be 'white', 'black', or 'flip'.

6482 - Invalid Position Value (Method)

  • Error Text: Invalid value passed to the position method.
  • Description: Position must be either 'start', a valid FEN String, or a valid Position Object.

7263 - Invalid Position Value (Config)

  • Error Text: Invalid value passed to config.position
  • Description: Position must either be 'start', a valid FEN String, or a Position Object.

8272 - Internal Piece Theme Error

  • Error Text: Unable to build image source for config.pieceTheme.
  • Description: This is an internal Chessboard error that you should never see. If you see this error please open a GitHub issue.

8273 - Internal NAG Theme Error (New!)

  • Error Text: Unable to build image source for config.nagTheme.
  • Description: This is also an internal Chessboard error that you should never see. If you see this error please open a GitHub issue.