vue-demi
vue-demi copied to clipboard
createElementVNode is not a function with @vue/cli
Hi there,
I'm struggling to make a lib with @vue/cli and stuck because @vue/cli looks like a minor choice for vue-demi.
vue.config.js:
module.exports = {
configureWebpack: {
externals: {
'vue-demi': 'vue-demi',
},
},
};
user outputs the error (vue 2.6.14):
TypeError: (0 , external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode) is not a function
It does not seem that there is such a method createElementVNode in Vue2. Is this an issue only with @vue/cli?
env: vue-demi 0.12.1, vue 3.2.22, @vue/cli 5.0.0-rc.0
I realized it might be related #22. Vue plugin library may be impossible made with vue-demi.
It is caused by vue 3.2 breaking change https://github.com/vuejs/vue-next/pull/3334 . Also, @vue/cli v5 does not support vue3.1 https://github.com/vuejs/vue-cli/pull/6808 . well, deadlocked
So what we are saying right now is that it's impossible to create a ui compnoents library that is compatible vue2 and vue3 ?.... That's a big problem here...
I had a similar problem but for me it fails to find defineComponent
It fails at this line
/* harmony default export */ var Iconvue_type_script_setup_true_lang_ts = (/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
My use case
I built a component library with vue-demi, based in Vue 3.2. I installed in another project with Vue3.2 and it worked.
When I try to install it in a Vue 2 project it says:
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"]) is not a function
@vue/cli 4.5.15
let's track #152