Currently, I am in the process of creating a Vue component by utilizing the functionalities provided by the JavaScript plugin known as Cropper JS. The application is developed using Laravel 5.6. Initially, I installed Cropper JS via NPM:
npm install cropperjs
Following this, within my resources/assets/js/app.js file, I included the following code:
import Cropper from 'cropperjs'
Vue.use(Cropper);
For context, it can be assumed that Vue has been correctly configured up to this point.
While compiling with 'npm run watch' works without any issues, upon visiting my web application (which currently only displays Hello World), an error appears in the console stating:
Uncaught TypeError: Cannot call a class as a function
In previous instances, I have successfully imported and utilized libraries acquired through npm using the same commands. However, the folder structure seemed to be slightly different back then; perhaps optimized for Vue?
Within the node_modules/cropperjs directory, the structure is organized as follows:
/dist
/src
/types
CHANGELOG.md
LICENSE
package.json
README.md
I trust that this information will aid in diagnosing the error effectively.
Thank you.