Agontuk / vue-cropperjs

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

I can't seem to get this to work as a component #91

Closed dajeinc closed 3 years ago

dajeinc commented 3 years ago

EDIT: YOU HAVE TO USE V4.0 WITH VUE 3

// Install 4.0.0 npm install --save-dev vue-cropperjs@4.0.0

Ive been trying for a couple of days. New to Vue so maybe I am missing something.

When I put your code in a clean Vue3 Cli project it works great.

When I put it into a component and then use that component in a view it breaks.

h is not a function I try to import h inside your code and then exports.default breaks.

Any help?

tachang commented 3 years ago

Same issue.

VueCropper.js?95c3:21 Uncaught (in promise) TypeError: h is not a function
    at Proxy.render (VueCropper.js?95c3:21)
    at renderComponentRoot (runtime-core.esm-bundler.js?5c40:710)
    at componentEffect (runtime-core.esm-bundler.js?5c40:4193)
    at reactiveEffect (reactivity.esm-bundler.js?a1e9:42)
    at effect (reactivity.esm-bundler.js?a1e9:17)
    at setupRenderEffect (runtime-core.esm-bundler.js?5c40:4176)
    at mountComponent (runtime-core.esm-bundler.js?5c40:4134)
    at processComponent (runtime-core.esm-bundler.js?5c40:4094)
    at patch (runtime-core.esm-bundler.js?5c40:3715)
    at mountChildren (runtime-core.esm-bundler.js?5c40:3897)
namasterohith commented 3 years ago

Hi guys, (@dajeinc, @tachang) Seems that Vue 3 support hasn't been published to NPM yet. Latest release still 4.2.0 without Vue 3 support. I fixed this problem by directly installing from GitHub instead of NPM library.

npm i git+https://github.com/Agontuk/vue-cropperjs.git

But hope this gets fixed by @Agontuk by publishing the latest release. (https://github.com/Agontuk/vue-cropperjs/pull/92)

Hope the above command can help someone till that happens.

Agontuk commented 3 years ago

v5.0.0 has been published

Awatatah commented 3 years ago

@Agontuk I'm having same issue with latest from npm

[Vue warn]: Error in render: "TypeError: (0 , _vue.h) is not a function"

LiuYaoChang commented 3 years ago

still not fixed the issue yet.

sbinfo commented 3 years ago

// Uninstall the latest version of vue-croppperjs npm uninstall --save-dev vue-cropperjs

// Install 4.0.0 npm install --save-dev vue-cropperjs@4.0.0

Agontuk commented 3 years ago

Guys, please check the compatibility section in the readme.