\r\n \u003C/button>\r\n \u003C/label>\r\n\u003C/template>\r\n```\r\n\r\nBuild output:\r\n```js\r\nimport { defineComponent, ref, openBlock, createElementBlock, createTextVNode, toDisplayString, createElementVNode, mergeProps, renderSlot } from \"vue\";\r\nconst _sfc_main = /* @__PURE__ */ defineComponent({\r\n props: {\r\n label: {\r\n type: String,\r\n default: \"\"\r\n }\r\n },\r\n setup(__props) {\r\n const counter = ref(0);\r\n return (_ctx, _cache) => {\r\n return openBlock(), createElementBlock(\"label\", null, [\r\n createTextVNode(toDisplayString(__props.label) + \" \" + toDisplayString(counter.value) + \" \", 1),\r\n createElementVNode(\"button\", mergeProps(_ctx.$attrs, {\r\n onClick: _cache[0] || (_cache[0] = ($event) => counter.value++)\r\n }), [\r\n renderSlot(_ctx.$slots, \"default\")\r\n ], 16)\r\n ]);\r\n };\r\n }\r\n});\r\nexport { _sfc_main as BaseButton };\r\n```\r\n\r\nIn Vue 2 I run into `Uncaught TypeError: Object(...) is not a function` error with `defineComponent()`. I suppose it should be importing from \"vue-demi\" instead of \"vue\"?\r\n\r\nPackage.json\r\n```json\r\n\"dependencies\": {\r\n \"vue-demi\": \"^0.12.4\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/node\": \"^17.0.21\",\r\n \"@vitejs/plugin-vue\": \"^2.2.0\",\r\n \"@vue/composition-api\": \"^1.4.9\",\r\n \"typescript\": \"^4.5.4\",\r\n \"vite\": \"^2.8.0\",\r\n \"vue\": \"^3.2.25\",\r\n \"vue-tsc\": \"^0.29.8\"\r\n },\r\n \"peerDependencies\": {\r\n \"@vue/composition-api\": \"^1.0.0-rc.1\",\r\n \"vue\": \"^2.0.0 || >=3.0.0\"\r\n },\r\n \"peerDependenciesMeta\": {\r\n \"@vue/composition-api\": {\r\n \"optional\": true\r\n }\r\n },\r\n```\r\n\r\nvite.config.ts\r\n```ts\r\nexport default defineConfig({\r\n plugins: [vue()],\r\n build: {\r\n lib: {\r\n entry: path.resolve(__dirname, \"src/lib.ts\"),\r\n name: \"myLib\",\r\n fileName: (format) => `lib.${format}.js`,\r\n },\r\n rollupOptions: {\r\n // make sure to externalize deps that shouldn't be bundled\r\n // into your library\r\n external: [\"vue\"],\r\n output: {\r\n // Provide global variables to use in the UMD build\r\n // for externalized deps\r\n globals: {\r\n vue: \"Vue\",\r\n },\r\n },\r\n },\r\n },\r\n optimizeDeps: {\r\n exclude: [\"vue-demi\"],\r\n },\r\n});\r\n```",[],145,"Not running on Vue 2 App","2022-09-04T15:48:05Z","https://github.com/vueuse/vue-demi/issues/145",0.70388967,{"description":2908,"labels":2909,"number":2910,"owner":2868,"repository":2869,"state":2894,"title":2911,"updated_at":2912,"url":2913,"score":2914},"Vue2 components is compiled.",[],33,"Is it Supported in vue3 project use Vue2 components?","2021-07-15T17:17:22Z","https://github.com/vueuse/vue-demi/issues/33",0.70419055,{"description":2916,"labels":2917,"number":2918,"owner":2868,"repository":2869,"state":2894,"title":2919,"updated_at":2920,"url":2921,"score":2922},"When I debug the plug-in locally(use: npm link)\r\n\r\n`import { isVue2, isVue3 } from \"vue-demi\";`\r\n\r\n`console.log(isVue2, isVue3) // false true`\r\n\r\nWhen I publish\r\n\r\n`import { isVue2, isVue3 } from \"vue-demi\";`\r\n\r\n`console.log(isVue2, isVue3) // true false `\r\n\r\n\r\nthey are all in vue2 project",[],218,"\"isVue2 isVue3\" there are differences in different environments","2023-03-06T05:59:57Z","https://github.com/vueuse/vue-demi/issues/218",0.7044235,{"description":2924,"labels":2925,"number":2926,"owner":2868,"repository":2869,"state":2894,"title":2927,"updated_at":2928,"url":2929,"score":2930},"Hi, sorry that I'm creating a following issue to #22 but I don't have the right to re-open and I'm still a little bit stuck.\r\n\r\n**Problem**\r\n\r\n`\"export 'defineComponent | computed |. etc' was not found in 'vue' ` \r\n\r\nSince my library exports components created using `defineComponent` it doesn't work in a project with `vue 2`\r\n\u003Cimg width=\"659\" alt=\"Screenshot 2020-12-28 at 12 03 11\" src=\"https://user-images.githubusercontent.com/4699008/103209997-b3ca2b80-4904-11eb-93de-b00897a7dd2d.png\">\r\n\r\n\r\n**Steps** \r\n\r\n1. I created a [PR](https://github.com/asigloo/vue-dynamic-forms/pull/211) to follow the process described in the `README.md` in my [library](https://github.com/asigloo/vue-dynamic-forms), changed `vue` imports to `vue-demi`, added the `peerDependencies`, and installed everything.\r\n2. Publish a new version [3.11.0](https://www.npmjs.com/package/@asigloo/vue-dynamic-forms/v/3.11.0)\r\n3. In this [branch](https://github.com/asigloo/vue-dynamic-forms/tree/feature/isomorph-installation) I installed the last version on the `vue 2 demo` app ---> [link](https://github.com/asigloo/vue-dynamic-forms/tree/feature/isomorph-installation/demos/vue-2) \r\n4. Run `npm run serve`\r\n\r\nIf I understand correctly it's necessary to publish the npm package for vue-demi to work when installing on a Vue 2 or 3 project, is not possible to test/debug locally without publishing it?. \r\n\r\nThanks in advance",[],25,"export 'defineComponent | computed | etc' was not found in 'vue'","2021-01-08T07:35:21Z","https://github.com/vueuse/vue-demi/issues/25",0.70488316,{"description":2932,"labels":2933,"number":2934,"owner":2868,"repository":2869,"state":2894,"title":2935,"updated_at":2936,"url":2937,"score":2938},"Imports of `resolveDirective`, `withDirectives` and many other vue@3 modules are not found in `vue-demi` when used in vue@2 environments.\r\n\r\n```js\r\nimport {\r\n defineComponent,\r\n h,\r\n isVue2,\r\n resolveComponent,\r\n resolveDirective,\r\n withDirectives,\r\n vModelDynamic,\r\n vShow,\r\n} from 'vue-demi';\r\n```\r\n\r\nIn vue@2 environments this will result in an error like `\"export 'withDirectives' was not found in 'vue-demi'`.\r\n\r\nAny idea on how to handle these cases?",[],60,"resolveDirective, withDirectives and many other vue@3 modules are not found in vue-demi when used in vue@2 environments","2021-07-15T17:20:01Z","https://github.com/vueuse/vue-demi/issues/60",0.70690465,{"description":2940,"labels":2941,"number":2942,"owner":2868,"repository":2869,"state":2894,"title":2943,"updated_at":2944,"url":2945,"score":2946},"I have this code in my library project with vue 3:\r\n\r\n`\u003Cscript lang=\"ts\">\r\nimport { h, defineComponent, resolveComponent } from 'vue-demi'\r\n\r\nexport default defineComponent ({\r\n name: 'ivan-button',\r\n data() {\r\n return {\r\n msg: 'hello'\r\n }\r\n },\r\n render() {\r\n const oButton = resolveComponent('o-button')\r\n return h(oButton, { variant: 'success', size: 'small', label: this.msg, rounded: true })\r\n }\r\n})\r\n\u003C/script>`\r\n\r\nAnd, when I import my library in my vue 2 project, I have the following error:\r\n\r\n`\"export 'resolveComponent' (imported as 't') was not found in 'vue-demi'`\r\n\r\nAny idea?\r\n\r\nRegards y thanks.",[],181,"resolveComponent is not supported in vue 2","2022-09-04T17:56:41Z","https://github.com/vueuse/vue-demi/issues/181",0.7082277,["Reactive",2948],{},["Set"],["ShallowReactive",2951],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fDaEtur_ryFSMCgb-MoXYcnAYlV923be5kw2EfdlTJOg":-1},"/vueuse/vue-demi/148"]