Something in Board.js in the Minesweeper project prevents transpilation


#1

When I transpile Board.js, I get the following error, which, if I understood correctly, means that the transpilation failed because of something on line 21 in my Board.js file:

SyntaxError: src/game.js: Unexpected token (21:0)
  19 |     this._board = new Board(numberOfRows, numberOfColumns, numberOfBombs);
  20 |   }
> 21 |
     | ^
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! minesweeper@1.0.0 build: `babel src -d lib`
npm ERR! Exit status 1

The actual line 21 in my Board.js, in its context, is below (it contains only the curly brace immediately before the line where numberOfEmptySpaces is decremented):

  flipTile(rowIndex, columnIndex) {
    if (this._playerBoard[rowIndex][columnIndex] !== ' ') { //Clicking on an empty, uncovered cell.
      return;
    }
    if (this._bombBoard[rowIndex][columnIndex] === 'B') { //If clicked on a bomb.
      this._playerBoard[rowIndex][columnIndex] = 'B';
    } else { //If clicked on a still-covered tile without a bomb.
      this._playerBoard[rowIndex][columnIndex] = this.getNumberOfNeighborBombs(rowIndex, columnIndex);
    } // This is line 21 (comment not in my actual code).
    this._numberOfEmptySpaces--;
  }

Any idea as to what could be wrong here would be appreciated.


#2

Use the Slack channel or speak with an advisor. We cannot help you here.