Closed dmishins closed 10 months ago
I (partially) resolved my own issue. I believe this pertains to the way javascript modules are imported. The cropper.js file uses something that I don't quite understand called UMD. In principle, from what I've read, this should be possible to import directly, but I couldn't figure out how to make it work. Instead, I switched to the cropper.esm.js file, which worked immediately.
I am new to web development and am trying to use cropperJS v2 in a small project. I tried to follow the guide but can't seem to instantiate cropper. Here is the code I wrote for html
and main.js
I seem to get an error importing Cropper - on firefox, I see "Uncaught SyntaxError: ambiguous indirect export: Cropper" and on chromium "Uncaught SyntaxError: The requested module '../node_modules/cropperjs/dist/cropper.js' does not provide an export named 'Cropper'".
What am I doing wrong here? Is it possible to add a simple bare-bones example code using cropperjs2 in a website? Thank you so much, Daniel