1

I am new to electron and javascript. I want to use the library chesboardjs

on their website it says it is quite simple just 2 lines of code to display the board. I installed it using npm install -save @chrisoakman/chessboardjs now I want to use it but I have no idea how to import it. I don't see anything about that on the website.

  • Their website assumes that you have a basic understanding of imports in general, or as specified in the Electron docs. This isn't something specific to that library. – isherwood Jul 30 '21 at 19:38
  • Does this answer your question? https://stackoverflow.com/questions/62671803/how-to-use-import-or-require-in-electron – isherwood Jul 30 '21 at 19:40
  • Does this answer your question? [how to use import or require in electron](https://stackoverflow.com/questions/62671803/how-to-use-import-or-require-in-electron) – SuperDJ Jul 30 '21 at 19:42
  • I tried this ```import { Chessboard } from "./node_modules/@chrisoakman/chessboardjs/dist/chessboard-1.0.0.js";```but I am getting this error ```Uncaught SyntaxError: The requested module './node_modules/@chrisoakman/chessboardjs/dist/chessboard-1.0.0.js' does not provide an export named 'Chessboard'``` – Aggressive-Support35 Jul 30 '21 at 22:29
  • 1
    Is that the file I should actually import BTW? It said nowhere I just assumed. – Aggressive-Support35 Jul 31 '21 at 07:28

0 Answers0