vue-demi icon indicating copy to clipboard operation
vue-demi copied to clipboard

createElementVNode is not a function with @vue/cli

Open koooge opened this issue 4 years ago • 4 comments

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

koooge avatar Nov 15 '21 15:11 koooge

I realized it might be related #22. Vue plugin library may be impossible made with vue-demi.

koooge avatar Nov 16 '21 15:11 koooge

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

koooge avatar Nov 16 '21 20:11 koooge

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...

flozero avatar Feb 16 '22 04:02 flozero

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

lianulloa avatar Mar 03 '22 14:03 lianulloa

let's track #152

sxzz avatar Sep 04 '22 15:09 sxzz