Trying to use the croppie library on product detail page and sometime it works perfectly but most of the time it throws one of these errors.
TypeError: priceBoxes.priceBox is not a function
Uncaught TypeError: $(...).croppie is not a function
Every time i open the product page first time in incognito or hard refreshes the page, it always works but when i refreshes the page, it throws these errors.
croppie js path in my theme:
app/design/frontend/Theme_Vendor/Theme/web/js/croppie.js
var config = {
paths: {
croppie: 'js/croppie'
}
};
app/design/frontend/Theme_Vendor/Theme/Magento_Catalog/templates/product/view/gallery.phtml:
require([
'jquery',
'domReady!',
'croppie'
], function($){
$('.demo').croppie({
url: 'demo/demo-1.jpg',
});
});
function($)
, tofunction($, croppie)
, and then trying to instantiate croppie another way, but if / when I find out more i'll let you know.