Agontuk / vue-cropperjs

A Vue wrapper component for cropperjs https://github.com/fengyuanchen/cropperjs
MIT License
937 stars 224 forks source link

Updating to vue 3.4.7 from 3.4.8 breaks things. #132

Open kriserickson opened 5 months ago

kriserickson commented 5 months ago

Updating Vue to 3.4.8 from 3.4.7 breaks the component.

I'm using Quasar, Vue, and Vite and this.$refs.img becomes undefined when upgrading to Vue 3.4.8. I've tested updating the example app and it still works. I've created a pull-request to fix this, https://github.com/Agontuk/vue-cropperjs/pull/131 but it is an ugly solution.

vue-cropperjs.js?v=800a251e:37638 Uncaught (in promise) Error: The first argument is required and must be an <img> or <canvas> element.
    at new Cropper2 (vue-cropperjs.js?v=800a251e:37638:19)
    at Proxy.mounted (vue-cropperjs.js?v=800a251e:38096:24)
    at chunk-3UYGRKYA.js?v=6e88d377:4254:154
    at callWithErrorHandling (chunk-3UYGRKYA.js?v=6e88d377:1638:19)
    at callWithAsyncErrorHandling (chunk-3UYGRKYA.js?v=6e88d377:1645:17)
    at hook.__weh.hook.__weh (chunk-3UYGRKYA.js?v=6e88d377:4236:19)
    at flushPostFlushCbs (chunk-3UYGRKYA.js?v=6e88d377:1820:41)
    at flushJobs (chunk-3UYGRKYA.js?v=6e88d377:1858:5)



MrIsaacs commented 1 month ago

I think it's important to note that before your changes are accepted, we need to make sure that these changes are backwards compatible. The way some programmers used it in their projects before could result in the entire component becoming incompatible.

I don't know what impact this can cause, but it might even be possible by adding your customizations as an option and not removing the existing code.

amandine-trl commented 1 week ago

Hi! I'm experiencing the exact same issue as described here. I was wondering if there have been any updates or workarounds discovered for this? Any help would be greatly appreciated!