\n\n`defineProps` works fine\n\u003Cimg width=\"680\" height=\"215\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d3f33a4a-72e3-4c0c-a94b-bf37ad05d356\" />\n\nPerhaps the issue lies here.\n\u003Cimg width=\"552\" height=\"290\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/4a0d2211-92a1-4dab-9ab6-3c819ddefb4c\" />\n\n### Reproduction\n\nhttps://playground.vueuse.org/#eNqVkk1z0zAQhv/K4kviwR9lYDgEJxMoPcABOqE3zMG1N6laWRKSbNLJ+L+zlmyTMJBpLx5L++7us6v3ELxXKmkbDBZBZkrNlAWDtlHAC7Fb5oE1ebDKBauV1BYOUGosLG6wMcUtxxusFaczdLDVsobZmko1BtNSapy9O8ortC4eIxBNfYs6gm0jyimJcmL7qNDMcpGLUgpj4ftH3DIxNYigbzkdf8DyPyTzQy4AlJbKLMD9A3Bm7MITZB5gNQ8TZjb4s2Eaq8jLmKhwvxgQSVDhdh6/CoeoFJeclQ8Lh57NT8QhLFfQSlZRXSfv6NuFNP84jgMiaKpJU133J0/6JLZzZM/g6sIeKEv9O9Or0sEOe6MTQHa6dGhjw6UlFxwcZ+RBorEndM4b/XayF3EM/RsCai01xPEYqFgL67KXU50h0VOGlD2WylLSeYb0FMJh+jpDyQpr6ZX+LkuPhgiiwHsurguV3BspyNlu0/kQIENPzsiDyXv9bR7cWUvGSdOyEpRcIWetTgTaVKg6nbTrt8lFcpG+RFPngXtvWi51toZee8t2f/UtZa0YR/1VWUZuOOlfcC5/fXZ3Vjc4mI1y7rB8+Mf9vdl70muNBnWLeTDFbKF3aH346tsX3NP/FKxl1XBSnwlu0Eje9Ixe9qERFWEf6RztJ7dGJnY35mpvUZhxqB50dP+w28szo//BfZ28mbbY/QaxVIgQ\n\n### System Info\n\n```Shell\n\"@vueuse/core\": \"^13.2.0\"\n\"vue-types\": \"^5.1.3\"\n\"typescript\": \"^5.8.3\",\n```\n\n### Used Package Manager\n\npnpm\n\n### Validations\n\n- [x] Follow our [Code of Conduct](https://github.com/vueuse/vueuse/blob/main/CODE_OF_CONDUCT.md)\n- [x] Read the [Contributing Guidelines](https://github.com/vueuse/vueuse/blob/main/CONTRIBUTING.md).\n- [x] Read the [docs](https://vueuse.org/guide).\n- [x] Check that there isn't [already an issue](https://github.com/vueuse/vueuse/issues) that reports the same bug to avoid creating a duplicate.\n- [x] Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.\n- [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vueuse/vueuse/discussions).\n- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[3190],{"name":3191,"color":3192},"pending triage","d73a4a",4929,"BUG | `createReusableTemplate` | Not compatible with the `vue-types` library","2025-07-31T02:11:46Z","https://github.com/vueuse/vueuse/issues/4929",0.70996094,{"description":3199,"labels":3200,"number":3201,"owner":3172,"repository":3173,"state":3174,"title":3202,"updated_at":3203,"url":3204,"score":3205},"I've been having a difficult time working out how to build a universal component library with SFCs that can be used by both Vue2 and Vue3 apps bundled together in a Yarn 3 workspaces monorepo. \r\n\r\nI have created a (failing) [proof of concept](https://github.com/phobetron/demi-components-poc) project. The library builds, and the Vue3 app renders it correctly. However, the Vue 2 app will not build, and gives the following error:\r\n\r\n```plain text\r\nfailed to load config from \u003Cpath to>demi-components-poc/packages/example-vue2/vite.config.ts\r\nerror when starting dev server:\r\nError:\r\n\r\nVue packages version mismatch:\r\n\r\n- vue@3.2.31 (\u003Cpath to>demi-components-poc/node_modules/vue/index.js)\r\n- vue-template-compiler@2.6.14 (\u003Cpath to>demi-components-poc/node_modules/vue-template-compiler/package.json)\r\n\r\nThis may cause things to work incorrectly. Make sure to use the same version for both.\r\nIf you are using vue-loader@>=10.0, simply update vue-template-compiler.\r\nIf you are using vue-loader@\u003C10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.\r\n\r\n at Object.\u003Canonymous> (\u003Cpath to>demi-components-poc/node_modules/vue-template-compiler/index.js:10:9)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\r\n at Module.load (node:internal/modules/cjs/loader:981:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:1005:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003Canonymous> (\u003Cpath to>demi-components-poc/node_modules/vite-plugin-vue2/dist/utils/descriptorCache.js:30:42)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\r\n at Module.load (node:internal/modules/cjs/loader:981:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at Module.require (node:internal/modules/cjs/loader:1005:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at Object.\u003Canonymous> (\u003Cpath to>demi-components-poc/node_modules/vite-plugin-vue2/dist/main.js:29:27)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n```\r\n\r\nI've attempted various arrangements of `vue-demi-switch` calls, but this exact error occurs regardless, so I've left that out of the PoC.\r\n\r\nThe library, as well as both Vue apps, are built using Vite. Is there an incompatibility with `vue-demi` SFCs and Yarn workspaces, or maybe in how Vite loads Vue?",[],139,"Shared `vue-demi` SFC Library & Yarn 3 Workspace Compatibility Issues","2022-03-09T18:15:13Z","https://github.com/vueuse/vue-demi/issues/139",0.71483344,{"description":3207,"labels":3208,"number":3209,"owner":3172,"repository":3173,"state":3210,"title":3211,"updated_at":3212,"url":3213,"score":3214},"使用 @antv/x6-vue-shape 包时,出现以下问题:\r\n使用npm本地启动项目时,控制台出现:\r\n\r\n打开设计器页面出现以下问题:\r\n\r\n尝试过使用 vue-demi-fix 以及 vue-demi-switch 2 都没有解决。",[],207,"closed","\"export 'defineComponent' was not found in 'vue-demi'","2025-01-02T03:38:26Z","https://github.com/vueuse/vue-demi/issues/207",0.6820071,{"description":3216,"labels":3217,"number":3218,"owner":3172,"repository":3173,"state":3210,"title":3219,"updated_at":3220,"url":3221,"score":3222},"Hello !\r\n\r\nThanks for the work on this. It's certailny an issue with typescript itself but as I am new with it I can't figure what I am doing wrong.\r\n\r\nI followed the installation step and my IDE and Rollup build don't stop to tell me that vue-demi does not export all the vue function:\r\n\r\n\r\n\r\n\r\n",[],42,"No exported member 'ref'","2021-02-26T18:07:33Z","https://github.com/vueuse/vue-demi/issues/42",0.70314866,{"description":3224,"labels":3225,"number":3226,"owner":3172,"repository":3173,"state":3210,"title":3227,"updated_at":3228,"url":3229,"score":3230},"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.70365,{"description":3232,"labels":3233,"number":3234,"owner":3172,"repository":3172,"state":3210,"title":3235,"updated_at":3236,"url":3237,"score":3238},"```node\r\n$ yarn build \r\nnode_modules/@vueuse/core/index.d.ts:5:42 - error TS2305: Module '\"vue-demi\"' has no exported member 'ComponentPublicInstance'.\r\n\r\n5 import { Ref, InjectionKey, ComputedRef, ComponentPublicInstance, UnwrapRef, ToRefs } from 'vue-demi';\r\n ~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n\r\nFound 1 error.\r\n```",[],772,"TS2305: Module '\"vue-demi\"' has no exported member 'ComponentPublicInstance'.","2021-09-21T19:01:40Z","https://github.com/vueuse/vueuse/issues/772",0.7111491,{"description":3240,"labels":3241,"number":1587,"owner":3172,"repository":3173,"state":3210,"title":3242,"updated_at":3243,"url":3244,"score":3245},"Hello @antfu ,\r\n\r\nI am currently working on a SPA using `vue2` + `options-api` . This SPA imports another component library (`vue2` + `@vue/composition-api`), which simply exposes a single vue component. The component library also uses `@vueuse/core` using `vue-demi`.\r\n\r\nHere's an example of the exported component of the library (can not share everything since it's an company internal project)\r\n```vue\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n \u003Cp>FOO: {{ blub }}\u003C/p> \u003C!-- will stay false -->\r\n \u003Cbutton @click.stop=\"click\">CLICK ME\u003C/button>\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript>\r\nimport { defineComponent, ref } from \"@vue/composition-api\"\r\nimport { useLocalStorage } from \"@vueuse/core\"\r\n\r\nexport default defineComponent({\r\n setup: (props) => {\r\n const foo = ref(false)\r\n\r\n const storageLocale = useLocalStorage(\"some_key\", \"en-GB\", {\r\n listenToStorageChanges: true,\r\n window,\r\n })\r\n\r\n return {\r\n foo,\r\n click: () => {\r\n console.log(\"before click\", foo.value)\r\n foo.value = true\r\n console.log(\"after click\", foo.value) // \u003C-- will be true\r\n },\r\n }\r\n },\r\n})\r\n\u003C/script>\r\n```\r\n\r\nSo basically everything works pretty good. But as soon as I add the `useLocalStorage` or any other composable from `@vueuse/core`, the template will not re-render as soon as the button was clicked. The ref value itself works, only the template does not update. I did a lot of debugging together with my colleague, and we figured out that the template will update, as soon as we get rid of all `vue-demi` based code.\r\n\r\nDependencies of the SPA:\r\n```json\r\n\"dependencies\": {\r\n \"vue\": \"^2.6.10\",\r\n \"@company/components\": \"1.0.0\",\r\n \"@vue/composition-api\": \"1.0.0-beta.25\"\r\n},\r\n\"devDependencies\": {\r\n ... all other\r\n}\r\n``` \r\nDependencies of the ComponentLibrary: \r\n```json\r\n\"dependencies\": {\r\n \"@vueuse/core\": \"4.0.10\"\r\n},\r\n\"devDependencies\": {\r\n \"vue\": \"^2.6.10\",\r\n \"@vue/composition-api\": \"1.0.0-beta.25\"\r\n ... all other\r\n}\r\n```\r\n\r\nDo you know what could be the issue here?\r\n\r\nKind regards,\r\nLukas",[],"vue-demi breaks composition-api template re-rendering (vue2)","2021-02-06T14:34:10Z","https://github.com/vueuse/vue-demi/issues/35",0.7132929,{"description":3247,"labels":3248,"number":3249,"owner":3172,"repository":3173,"state":3210,"title":3250,"updated_at":3251,"url":3252,"score":3253},"I am using vue-cli-service to compile my library which uses vue-demi and I develop the code using vue 3.2.X.\r\nWhen I import the library in a vue2 project `vue-demi` detects vue3 is running instead of vue2.\r\n\r\nThis is a console log of following in my library, which I imported in my application.\r\n```js\r\nimport * as VueDemi from 'vue-demi';\r\nconsole.log(VueDemi)\r\n```\r\n\r\n\r\n\r\n\r\nHere's a repo to reproduce it \r\n[https://github.com/pareshchouhan/vue-demi-test](https://github.com/pareshchouhan/vue-demi-test) \r\n\r\nIn my library only thing I use vue-demi is for importing defineComponent\r\n\r\n```js\r\nimport { defineComponent } from 'vue-demi';\r\n````\r\n\r\nIt crashes inside the library code when calling `defineComponent`\r\n\r\n",[],121,"Library uses vue-demi with vue3, app uses vue2 but still vue-demi detects vue3","2021-12-02T15:13:46Z","https://github.com/vueuse/vue-demi/issues/121",0.7141,["Reactive",3255],{},["Set"],["ShallowReactive",3258],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f2Cg8HkGUJH4rAUqVumVOrU31WkiVySiTXNFwDQH1vLo":-1},"/vueuse/vue-demi/140"]