\r\n`\"vue\":\"^2.6.14\"`\r\n`\"@vue/composition-api\":\"^1.4.1\"`\r\n\r\nCan anyone advise?\r\n\r\nMy only resolution atm is to downgrade and duplicate vueUse functionality intending for use.\r\n",[],1070,"Vue2 + Vue composition-api: Error in data(): \"TypeError: vueDemi.getCurrentScope is not a function\"","2022-09-21T19:28:08Z","https://github.com/vueuse/vueuse/issues/1070",0.6906357,{"description":3189,"labels":3190,"number":3191,"owner":3173,"repository":3173,"state":3175,"title":3192,"updated_at":3193,"url":3194,"score":3195},"\r\n \r\nI don't know why this is happening.\r\n\r\nI use vueuse in vue2.6.11 with vue-composition-api\r\n",[],809,"Bug: Error in data(): \"TypeError: vueDemi.getCurrentScope is not a function\"","2021-09-30T02:19:33Z","https://github.com/vueuse/vueuse/issues/809",0.69552237,{"description":3197,"labels":3198,"number":3199,"owner":3173,"repository":3174,"state":3175,"title":3200,"updated_at":3201,"url":3202,"score":3203},"\r\n\r\n\r\nWhen using in Vue 2.6, the hasInjectionContext method will be executed. At this point, the default method exposed by VueCompositionAPI is only install. You need to selectively import getCurrentInstance.",[],231,"Vue 2.6: Error \"VueCompositionAPI.getCurrentInstance is not a function\" in hasInjectionContext()","2023-05-18T10:21:16Z","https://github.com/vueuse/vue-demi/issues/231",0.70106447,{"description":3205,"labels":3206,"number":3207,"owner":3173,"repository":3173,"state":3175,"title":3208,"updated_at":3209,"url":3210,"score":3211},"I've created a project with vite+vue2(using plugin)+vueuse and it looks like vueuse doesn't work properly in this setup.\r\n\r\nThe error I get:\r\n\r\n```\r\nvue.runtime.esm.js:619 [Vue warn]: Error in data(): \"ReferenceError: ref3 is not defined\"\r\n\r\nfound in\r\n\r\n---> \u003CAnonymous>\r\n \u003CRoot>\r\nwarn @ vue.runtime.esm.js:619\r\nvue.runtime.esm.js:1888 ReferenceError: ref3 is not defined\r\n at Object.ref (index.esm.js:1)\r\n at useCounter (index.esm.js:698)\r\n at setup (App.vue:21)\r\n at mergedSetupFn (vue-composition-api.esm.js:1741)\r\n at vue-composition-api.esm.js:1527\r\n at activateCurrentInstance (vue-composition-api.esm.js:1454)\r\n at initSetup (vue-composition-api.esm.js:1525)\r\n at VueComponent.wrappedData (vue-composition-api.esm.js:1509)\r\n at getData (vue.runtime.esm.js:4748)\r\n at initData (vue.runtime.esm.js:4705)\r\n```\r\n\r\nI tried `useCounter` and `useStorage`, but I think it can be replicated with other methods.\r\n\r\nHere is the project link to replicate: \r\nhttps://github.com/localhost5001/vite-vue2-vueuse-template",[],485,"Incompatible with vite and vue2","2021-05-05T20:52:10Z","https://github.com/vueuse/vueuse/issues/485",0.70178795,{"description":3213,"labels":3214,"number":3215,"owner":3173,"repository":3174,"state":3175,"title":3216,"updated_at":3217,"url":3218,"score":3219},"问题1: 一个vue3的组件在vue3环境下打包后的 在vue3的demo中使用组件样式未生效,getCurrentInstance获得的是null\r\n` import {\r\n defineComponent,\r\n ref,\r\n Vue2,\r\n isVue2,\r\n isVue3,\r\n getCurrentInstance,\r\n createVNode,\r\n render\r\n } from 'vue-demi';\r\n // import { createVNode, render } from 'vue'; // 若使用demo环境中的vue样式是生效的\r\n import Card from './card.vue';\r\n\r\n export default defineComponent({\r\n setup(props, context) {\r\n const btnFun = () => {\r\n cardShow();\r\n };\r\n\r\n const cardShow = () => {\r\n const node = document.getElementById('game-card');\r\n if (!node) {\r\n // 在vue2环境没有问题\r\n if (isVue2) {\r\n const gameCardComponent = Vue2.extend(Card);\r\n const gameCardInstance = new gameCardComponent({\r\n propsData: {\r\n btnObj: this\r\n }\r\n }).$mount();\r\n document.body.appendChild(gameCardInstance.$el);\r\n }\r\n if (isVue3) {\r\n const instance = getCurrentInstance();\r\n console.log(instance); // 打印为null\r\n const gameCardComponent = createVNode(Card, {\r\n btnObj: instance\r\n });\r\n render(gameCardComponent, document.querySelector('body'));\r\n }\r\n }\r\n };\r\n\r\n return {\r\n button_name,\r\n btnFun\r\n };\r\n }\r\n });`\r\n\r\n问题2: 一个vue3的组件在vue2环境下使用打包后的 在vue2的demo中\r\n\r\n",[],194,"在'vue-demi'中可以导出createVNode, render, getCurrentInstance这些vue3的方法使用吗?","2022-08-30T02:36:24Z","https://github.com/vueuse/vue-demi/issues/194",0.71231025,{"description":3213,"labels":3221,"number":3222,"owner":3173,"repository":3174,"state":3175,"title":3216,"updated_at":3223,"url":3224,"score":3219},[],195,"2022-08-26T12:48:02Z","https://github.com/vueuse/vue-demi/issues/195",{"description":3226,"labels":3227,"number":3234,"owner":3173,"repository":3173,"state":3175,"title":3235,"updated_at":3236,"url":3237,"score":3238},"### Describe the bug\n\nWith the following code:\n\n```\nimport { useLocalStorage } from \"@vueuse/core\";\nimport { watch } from \"vue\";\n\n//...\n\nconst removableRef = useLocalStorage\u003C\"a\" | \"b\" | \"c\">(\"key\", \"a\");\n\nwatch(removableRef, (newVal, oldVal) => {\n console.log(\"Changed removable ref\", oldVal, \"->\", newVal);\n if (newVal === \"b\") { // Typescript error here\n console.log(\"Changed to b\");\n }\n});\n\nwindow.setTimeout(() => {\n console.log(\"Setting to b\");\n removableRef.value = \"b\";\n}, 1_000);\n```\n\nI get a typescript error on the line indicated with a comment. \"This comparison appears to be unintentional because the types 'RemovableRef\u003C\"a\" | \"b\" | \"c\">' and 'string' have no overlap.ts(2367)\"\n\nElsewhere, I get typescript errors like \"This comparison appears to be unintentional because the types '{ [RefSymbol]: true; value: \"a\" | \"last7days\" | \"b\" | \"c\" ; }' and 'string' have no overlap.ts-plugin(2367)\"\n\nBut the code works. newVal is indeed \"b\", and \"Changed to b\" logs to the console.\n\nI am working around with\n\n```\nimport { useLocalStorage as _unsafeUseLocalStorage } from \"@vueuse/core\";\n\nfunction useLocalStorage\u003CT>(key: string, initialValue: T): Ref\u003CT> {\n //@ts-expect-error\n return _unsafeUseLocalStorage(key, initialValue);\n}\n```\n\nand then using the custom function instead. But wondering if there is a better solution, or if this can be fixed?\n\nNote, the playground seems to be broken when using vue2 and the corresponding vueuse version (11.3.0)\n\n### Reproduction\n\nhttps://playground.vueuse.org/?prod=true&vueuse=11.3.0#eNp9U21r2zAQ/iuHvjSB4GRrYdA52RsddIyurP0oKIp8sdXKkpFkJyHzf99JzlvH6CdLd4+ee+658459aZqsa5Fds9xLp5oAHkPbgBamnHMWPGcLbriR1vgAK9eqAHPgrBC1t4azjzE5ncKdDZUyJSgPhfKNFlu6TUCYAuiFFOYiwBKh3oK0BdJRitYj3EIlOqRYXaMJWAB26LYDlW1DBvfOLjXWsFahglAhROrS2dYUn2LpWFzVjXUBdkCMP60U+iFYJ0qEngTbGi4+U4eUm0rr8OLVi7UIsjriCEbpCHjd7j+8+al9+ENeeG1xf1y2WgtJt8WIsxfccjY5M2u8dytVHSX2CYysLr4PR4PrdBrDfAG75Cuo1QkB83n0fqg3PiCA7DPeasy0LansAJUVTZAMDRb2eCoe4X389EcpyhR2ndHQH1WNZPlodF49acw6oVtMYx+oElM/gcun2Ww2MOXTYX3SsuQBa5pTQLoB5IXqFknUNex2ibHv82mMxndnWDahhaNmVqrMnskx2krSAVSXFqRRGt2vJihqljOiipmYE1rb9Y8UC67FySEuK5Qv/4k/+02McXbv0KPrqKFjLghXYhjSNw93uKHzMVnbotWEfiP5G2kQbdQ4wL7SnpLsM1xSe5v2j5b80d9sAhp/aCoKjcg+4Tmjjfz2RusnuZfZVXrHTU8uPtFfFDnJwPfZh+zdFev/AsD+T2s=\n\n### System Info\n\n```Shell\nSystem:\n OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)\n CPU: (12) x64 13th Gen Intel(R) Core(TM) i5-1335U\n Memory: 13.44 GB / 19.38 GB\n Container: Yes\n Shell: 5.1.16 - /bin/bash\n Binaries:\n Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node\n npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm\n pnpm: 8.15.8 - ~/.nvm/versions/node/v20.16.0/bin/pnpm\n npmPackages:\n @vueuse/core: ^11.0.0 => 11.3.0\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.",[3228,3231],{"name":3229,"color":3230},"question","d876e3",{"name":3232,"color":3233},"pending triage","d73a4a",4999,"Typescript error when using RemovableRef","2025-09-02T08:35:37Z","https://github.com/vueuse/vueuse/issues/4999",0.7181854,{"description":3240,"labels":3241,"number":3247,"owner":3173,"repository":3173,"state":3175,"title":3248,"updated_at":3249,"url":3250,"score":3251},"### Describe the bug\n\nIn Vue `v3.6.0-alpha.1`, `getCurrentInstance()` returns `null` in Vapor components will cause these two functions to fail to run because they cannot pass the environment check\n\n\u003Cimg width=\"993\" height=\"266\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a667e11a-60b2-44c7-8699-8d092b0d9064\" />\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vitejs-vite-m1bs1kix?file=src%2FApp.vue\n\n### System Info\n\n```Shell\nSystem:\n OS: Windows 11 10.0.22631\n CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics\n Memory: 12.32 GB / 31.31 GB\nBinaries:\n Node: 22.15.1 - D:\\Program Files\\nodejs\\node.EXE\n npm: 10.9.2 - D:\\Program Files\\nodejs\\npm.CMD\n pnpm: 10.12.2 - D:\\Program Files\\nodejs\\pnpm.CMD\nBrowsers:\n Edge: Chromium (127.0.2651.98)\n Internet Explorer: 11.0.22621.3527\nnpmPackages:\n @vueuse/core: ^13.4.0 => 13.4.0\n vue: v3.6.0-alpha.1 => 3.6.0-alpha.1\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.",[3242,3244],{"name":3243,"color":3233},"bug",{"name":3245,"color":3246},"vue: vapor","929648",4875,"BUG | `provideLocal` and `injectLocal` | In Vue's vapor mode, `getCurrentInstance` returns `null`","2025-09-20T21:27:27Z","https://github.com/vueuse/vueuse/issues/4875",0.7197556,{"description":3253,"labels":3254,"number":3255,"owner":3173,"repository":3173,"state":3175,"title":3256,"updated_at":3257,"url":3258,"score":3259},"### Describe the bug\n\nwhen I use useIntervalFn from @vueuse/core in my vue project,but now, my IDE says \"cannot resolve symbol 'useIntervalFn'\" and it is red as on image below.\r\n\r\nAt the same time,when I check`node_modules`,it looks very strange,and It does not jump to where the function is declared.\r\n\r\n\r\nI tried to reinstall packages, nothing helped. \r\nI use `npm i @vueuse/core` to install it.\r\nApp still compiles without problems.\r\n\r\n\n\n### Reproduction\n\nnull\n\n### System Info\n\n```Shell\nIDE: WebStorm 2022,\r\nOS: Win 10,\r\n\"@vueuse/core\": \"^8.5.0\",\r\n\"vue\": \"^3.2.13\",\n```\n\n\n### Used Package Manager\n\nnpm\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.",[],1650," can not recognized useIntervalFn","2022-07-21T12:02:12Z","https://github.com/vueuse/vueuse/issues/1650",0.7201423,["Reactive",3261],{},["Set"],["ShallowReactive",3264],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fAJ_2o7NvOMS3dw_N77pVvsKVJPyt9rnA8M2jbFjWZRI":-1},"/vueuse/vue-demi/68"]