Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call crop in Vue #668

Open
jonatanvm opened this issue Oct 22, 2021 · 2 comments
Open

Cannot call crop in Vue #668

jonatanvm opened this issue Oct 22, 2021 · 2 comments
Labels

Comments

@jonatanvm
Copy link

jonatanvm commented Oct 22, 2021

Describe the bug
Calling crop causes error.

To Reproduce
Steps to reproduce the behavior:

Call crop method in Vue methods. Code:

applyCrop() {
     let cropZone = this.$refs.tuiImageEditor.invoke('getCropzoneRect')
     this.$nextTick(() => {
          this.$refs.tuiImageEditor.invoke('crop', cropZone)
     })
}

Error:

vue.runtime.esm.js?2b0e:1897 TypeError: Cannot read properties of null (reading '_set')
      at klass._onObjectAdded (tui-image-editor.js?abe2:9314)
      at klass.add (tui-image-editor.js?abe2:399)
      at Cropper.getCroppedImageData (tui-image-editor.js?abe2:50660)
      at Graphics.getCroppedImageData (tui-image-editor.js?abe2:57016)
      at ImageEditor.crop (tui-image-editor.js?abe2:58891)
      at VueComponent.invoke (toastui-vue-image-editor.js?feca:2)
      at VueComponent.eval (EditImageDialog.vue?b80e:234)
      at Array.eval (vue.runtime.esm.js?2b0e:1989)
      at flushCallbacks (vue.runtime.esm.js?2b0e:1915)

Expected behavior
Should not throw error.

Desktop (please complete the following information):

  • OS: macOS 11.6
  • chrome
  • Version 94.0.4606.81 (arm64)
@jonatanvm jonatanvm added the Bug label Oct 22, 2021
@lja1018
Copy link
Contributor

lja1018 commented Oct 27, 2021

@jonatanvm
Thank you for the report.
I'll check the bug and resolve it.

@Toflyer
Copy link

Toflyer commented Jun 23, 2023

It seems that this issue is still ongoing:

// this.imageEditorInstance.crop(this.imageEditorInstance.getCropzoneRect());

TypeError: Cannot read properties of null (reading '_set')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants