Search code examples
javascriptvue.jsnpmchessboard.js

Problem in importing chessboard.js in vue application


I am trying to import chessboard.js on my jetstream-vue application. After creating the project I ran npm install @chrisoakman/chessboardjs and it's in my node_modules folder. But when i tried import Chessboard from '@chrisoakman/chessboardjs' on app.js it shows error as

ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve '@chrisoakman/chessboardjs' in '/home/user/project-chess/resources/js'
 @ ./resources/js/app.js 9:0-51
 @ multi ./resources/js/app.js ./resources/css/app.css

Is there any other way I should try to import it or from to a different file than app.js.


Solution

  • @chrisoakman/chessboardjs can't be imported, since it doesn't export anything.

    Look at the code, at the end it says:

      // TODO: do module exports here