jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 130 forks source link

Uncaught TypeError: $(...).Jcrop is not a function in Django 2.2.14 #155

Closed bmihelac closed 3 years ago

bmihelac commented 3 years ago

After upgrading Django from 2.1.X to 2.2.14 following error occurs in admin:

jquery.js:4055 Uncaught TypeError: $(...).Jcrop is not a function
    at HTMLInputElement.<anonymous> (image_cropping.js:88)
    at Function.each (jquery.js:381)
    at jQuery.fn.init.each (jquery.js:203)
    at Object.init (image_cropping.js:4)
    at HTMLDocument.<anonymous> (image_cropping.js:197)
    at mightThrow (jquery.js:3762)
    at process (jquery.js:3830)

I noticed that jCrop is initialized to django.jQuery, instead to jQ

Anyone have similar issue?

2020-08-07_09-37

anrie commented 3 years ago

Hey @bmihelac,

this looks familiar to Issue #140 and is probably related to the new way of merging assets in Django 2.2.:

Could you please check if the issue also arises when using this branch?

bmihelac commented 3 years ago

@anrie thanks for answer, I'll check it asap

bmihelac commented 3 years ago

@anrie I have tested your branch and it works.

bmihelac commented 3 years ago

I'm closing this issue as it is fixed with https://github.com/jonasundderwolf/django-image-cropping/commit/e66c090071ded75f7c2578e8d9e7d48642c5a4ad