advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

Error: Cannot read property 'aspectRatios' of undefined #207

Closed itsamirhn closed 1 year ago

itsamirhn commented 1 year ago

In some use cases, some of our users get this error:

Cannot read property 'aspectRatios' of undefined

and It's accruing in this line.

Would you please help me what's the problem?

Norserium commented 1 year ago

@itsamirhn, this error is indeed theoretically possible.But the conditions are not clear at all. How did you get this information? Did you get it from Sentry?

itsamirhn commented 1 year ago

@itsamirhn, this error is indeed theoretically possible.But the conditions are not clear at all. How did you get this information? Did you get it from Sentry?

Yes it was from Sentry, Do you need any more information?

Norserium commented 1 year ago

@itsamirhn, the full trace log would be helpful. You may send it to my email (it's available in my profile) if it can't be published here.

Norserium commented 1 year ago

@itsamirhn, I assume it's possible if an user change something and within 500 ms swaps to an another page, but it should be pretty rare case.

How often is this error (in particular, relative to another errors)?

itsamirhn commented 1 year ago

It has first place in our errors events. I don't understand why this error is happening. Would you please give me some explain to how to fix this issue on our side?

Norserium commented 1 year ago

@itsamirhn, how much cases? Could you send the full screenshot of your issue to my email?

emmanuelsw commented 1 year ago

We are also experiencing this error, in our case the cropper is inside a modal, when I am uploading an image and at the moment of resizing the stencil I drag the mouse out of the modal is when the error shows up.

It may be that dragging the mouse out of the modal closes it and unmounts the cropper component, but I'm not sure.

itsamirhn commented 1 year ago

We are also experiencing this error, in our case the cropper is inside a modal, when I am uploading an image and at the moment of resizing the stencil I drag the mouse out of the modal is when the error shows up.

It may be that dragging the mouse out of the modal closes it and unmounts the cropper component, but I'm not sure.

Oh same, we're using it in a modal view.

Norserium commented 1 year ago

@itsamirhn, @emmanuelsw, try to update to 1.11.3 (if you use Vue 2, of course).

itsamirhn commented 1 year ago

After some testings, It seems the problems was when I was using cropper as modal (Vuetify v-dialog in this case) and a stepper in the background (Vuetify v-window in this case) and when the user stretch the crop border outside the modal, stepper was going to the next page and causes the error.

At the end, disabling manual swipe on stepper and updating to version 1.11.3 solved the issue.

Norserium commented 1 year ago

@itsamirhn, did you try update to version 1.11.3 only (without any other fixes)? It would be helpful for me.

itsamirhn commented 1 year ago

@itsamirhn, did you try update to version 1.11.3 only (without any other fixes)? It would be helpful for me.

Yes, And it was fine. Thanks for your update.

Norserium commented 1 year ago

@itsamirhn, it's great!