\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.6931511,{"description":2908,"labels":2909,"number":2910,"owner":2868,"repository":2868,"state":2870,"title":2911,"updated_at":2912,"url":2913,"score":2914},"### Describe the bug\n\n在正常的页面跳转中没有问题,但是一旦刷新页面就会报错,重复刷新两三次又能恢复正常一次\n\n### Reproduction\n\n无\n\n### System Info\n\n```Shell\n[Vue warn]: A plugin must either be a function or an object with an \"install\" function.\r\n[Vue Router warn]: uncaught error during route navigation:\r\nError [ERR_MODULE_NOT_FOUND]: Cannot find package 'vue-demi' imported from /root/mqingmo/server/node_modules/@vueuse/integrations/useQRCode.mjs\r\n at new NodeError (node:internal/errors:387:5)\r\n at packageResolve (node:internal/modules/esm/resolve:852:9)\r\n at moduleResolve (node:internal/modules/esm/resolve:901:20)\r\n at defaultResolve (node:internal/modules/esm/resolve:1115:11)\r\n at nextResolve (node:internal/modules/esm/loader:163:28)\r\n at ESMLoader.resolve (node:internal/modules/esm/loader:837:30)\r\n at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)\r\n at ModuleWrap.\u003Canonymous> (node:internal/modules/esm/module_job:76:40)\r\n at link (node:internal/modules/esm/module_job:75:36) {\r\n code: 'ERR_MODULE_NOT_FOUND'\r\n}\r\n```\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.",[],3018,"nuxt3二维码在服务器上刷新页面异常","2023-06-23T10:19:09Z","https://github.com/vueuse/vueuse/issues/3018",0.69913673,{"description":2916,"labels":2917,"number":2918,"owner":2868,"repository":2869,"state":2870,"title":2919,"updated_at":2920,"url":2921,"score":2922},"\r\nWhen I build with vitepress, get error\r\n\r\n/node_modules/@vueuse/shared/index.mjs:1\r\nimport { shallowRef, watchEffect, readonly, unref, ref, isVue3, version, watch, customRef, getCurrentScope, onScopeDispose, effectScope, provide, inject, isRef, computed, reactive, toRefs as toRefs$1, toRef, isVue2, set as set$1, getCurrentInstance, onBeforeMount, nextTick, onBeforeUnmount, onMounted, onUnmounted, isReactive } from 'vue-demi';\r\n ^^^^^^^^\r\nSyntaxError: The requested module 'vue-demi' does not provide an export named 'computed'\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:121:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:171:5)\r\n\r\nRemote\r\nSystem : Linux *86\r\nnode : v16.1.0\r\nnpm: 8.0.0\r\n\r\n\r\nbut I don't have this problem on my local window system\r\n\r\nlocal :\r\nsystem : window10\r\nnode:14.19.1\r\nnpm: 6.14.16",[],238,"The requested module 'vue-demi' does not provide an export named 'computed'","2023-06-12T10:58:49Z","https://github.com/vueuse/vue-demi/issues/238",0.6996731,{"description":2924,"labels":2925,"number":2926,"owner":2868,"repository":2869,"state":2870,"title":2927,"updated_at":2928,"url":2929,"score":2930},"Hi,\r\nThis issue because I've a problem trying to build our project on heroku: \r\nerror during build:\r\n\r\n```\r\n $ vite build\r\n\r\n vite v2.1.2 building for production...\r\n\r\n transforming...\r\n\r\n ✓ 2085 modules transformed.\r\n\r\n'Vue2' is not exported by ../../node_modules/vue-demi/lib/index.esm.js, imported by ../../node_modules/vue-echarts/dist/index.esm.min.js\r\n\r\nfile: /tmp/build_8432c290/node_modules/vue-echarts/dist/index.esm.min.js:1:180\r\n\r\n1: import{watch as e,inject as t,computed as n,unref as o,watchEffect as i,defineComponent as r,ref as a,shallowRef as u,toRefs as c,toRef as s,onMounted as l,onUnmounted as p,h as f,Vue2 as v,nextTick as d}from\"vue-demi\";import{throttle as h,init as g}from\"echarts/core\";import{addListener as O,removeListener as m}from\"resize-detector\";var y=function(){return(y=Object.assign||function(e){for(var t,n=1,o=arguments.length;n\u003Co;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},b=[\"getWidth\",\"getHeight\",\"getDom\",\"getOption\",\"resize\",\"dispatchAction\",\"convertToPixel\",\"convertFromPixel\",\"containPixel\",\"getDataURL\",\"getConnectedDataURL\",\"appendData\",\"clear\",\"isDisposed\",\"dispose\"];var j={autoresize:Boolean},x=\"ecLoadingOptions\";var L={loading:Boolean,loadingOptions:Object};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&\"undefined\"!=typeof document){var o=document.head||document.getElementsByTagName(\"head\")[0],i=document.createElement(\"style\");i.type=\"text/css\",\"top\"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(\"x-vue-echarts{display:block;width:100%;height:100%}\");var C=/^on[^a-z]/,U=function(e){return C.test(e)};v&&v.config.ignoredElements.push(\"x-vue-echarts\");var z=\"ecTheme\",D=\"ecInitOptions\",E=\"ecUpdateOptions\",w=r({name:\"echarts\",props:y(y({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},j),L),inheritAttrs:!1,setup:function(r,f){var v=f.attrs,j=f.listeners,x=a(),L=u(),C=u(),z=t(\"ecTheme\",null),D=t(\"ecInitOptions\",null),E=t(\"ecUpdateOptions\",null),w=n((function(){return C.value||r.option||Object.create(null)})),A=n((function(){return r.theme||o(z)||{}})),T=n((function(){return r.initOptions||o(D)||{}})),R=n((function(){return r.updateOptions||o(E)||{}})),B=c(r),P=B.autoresize,S=B.manualUpdate,k=B.loading,H=s(r,\"theme\"),I=s(r,\"initOptions\"),N=s(r,\"loadingOptions\"),W=n((function(){return function(e){var t={};for(var n in e)U(n)||(t[n]=e[n]);return t}(v)}));function F(e){if(!L.value&&x.value){var t=L.value=g(x.value,A.value,T.value);r.group&&(t.group=r.group);var n=j;n||(n={},Object.keys(v).filter((function(e){return 0===e.indexOf(\"on\")&&e.length>2})).forEach((function(e){var t=e.charAt(2).toLowerCase()+e.slice(3);n[t]=v[e]}))),Object.keys(n).forEach((function(e){var o=n[e];o&&(0===e.indexOf(\"zr:\")?t.getZr().on(e.slice(3).toLowerCase(),o):t.on(e.toLowerCase(),o))})),t.setOption(e||w.value,R.value),d(o),setTimeout(o)}function o(){t&&!t.isDisposed()&&t.resize()}}function Z(){L.value&&(L.value.dispose(),L.value=void 0)}var q=null;e(S,(function(t){\"function\"==typeof q&&(q(),q=null),t||(q=e((function(){return r.option}),(function(e){e&&(L.value?L.value.setOption(e,r.updateOptions):F())}),{deep:!0}))}),{immediate:!0}),e([H,I],(function(){Z(),F()}),{deep:!0}),i((function(){r.group&&L.value&&(L.value.group=r.group)}));var G=function(e,t){function n(n){return function(){for(var o=[],i=0;i\u003Carguments.length;i++)o[i]=arguments[i];if(e.value||t(),!e.value)throw new Error(\"ECharts is not initialized yet.\");return e.value[n].apply(e.value,o)}}function o(e){return n(e)}return y(y({},(i=Object.create(null),b.forEach((function(e){i[e]=n(e)})),i)),{dispatchAction:o(\"dispatchAction\"),getDataURL:o(\"getDataURL\"),getConnectedDataURL:o(\"getConnectedDataURL\")});var i}(L,F);!function(e,r,a){var u=t(\"ecLoadingOptions\",{}),c=n((function(){return y(y({},o(u)),null==a?void 0:a.value)}));i((function(){var t=e.value;t&&(r.value?t.showLoading(c.value):t.hideLoading())}))}(L,k,N),function(t,n,o,i){var r=null,a=0;function u(){var e=o.value;return e?e.offsetWidth*e.offsetHeight:0}e([o,t,n],(function(e,t,n){var o=e[0],c=e[1],s=e[2];o&&c&&s&&(a=u(),r=h((function(){0===a?(c.setOption(Object.create(null),!0),c.resize(),c.setOption(i.value,!0)):c.resize(),a=u()}),100),O(o,r)),n((function(){r&&o&&(a=0,m(o,r))}))}))}(L,P,x,w),l((function(){r.option&&F()})),p(Z);var J=y({root:x,setOption:function(e,t){r.manualUpdate&&(C.value=e),L.value?L.value.setOption(e,y(y({},R.value),t)):F(e)},nonEventAttrs:W},G);return Object.defineProperty(J,\"chart\",{get:function(){return o(L)}}),J},render:function(){var e=y({},this.nonEventAttrs);return e.ref=\"root\",e.class=e.class?[\"echarts\"].concat(e.class):\"echarts\",f(\"x-vue-echarts\",e)}});export default w;export{D as INIT_OPTIONS_KEY,x as LOADING_OPTIONS_KEY,z as THEME_KEY,E as UPDATE_OPTIONS_KEY};\r\n\r\n ^\r\n\r\n2: //# sourceMappingURL=index.esm.min.js.map\r\n\r\nerror during build:\r\n\r\nError: 'Vue2' is not exported by ../../node_modules/vue-demi/lib/index.esm.js, imported by ../../node_modules/vue-echarts/dist/index.esm.min.js\r\n\r\n at error (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:5307:30)\r\n\r\n at Module.error (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:9716:16)\r\n\r\n at Module.traceVariable (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:10104:29)\r\n\r\n at ModuleScope.findVariable (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:8874:39)\r\n\r\n at Identifier.bind (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:4042:40)\r\n\r\n at LogicalExpression.bind (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:2744:23)\r\n\r\n at LogicalExpression.bind (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:7824:15)\r\n\r\n at ExpressionStatement.bind (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:2744:23)\r\n\r\n at Program.bind (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:2740:31)\r\n\r\n at Module.bindReferences (/tmp/build_8432c290/node_modules/rollup/dist/shared/rollup.js:9712:18)\r\n\r\nerror Command failed with exit code 1.\r\n\r\n info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n\r\nerror Command failed.\r\n\r\nExit code: 1\r\n```\r\n\r\nI actually don't understand why we have this, as the build is ok in local... 🤔 \r\nWe use vue-3 and vitejs.\r\n\r\nAny ideas?\r\n\r\nThanks.\r\n\r\nIssue cross-posted in [vue-echarts](https://github.com/ecomfe/vue-echarts/issues/534)",[],51,"'Vue2' is not exported","2021-03-22T21:25:00Z","https://github.com/vueuse/vue-demi/issues/51",0.7034219,{"description":2932,"labels":2933,"number":2934,"owner":2868,"repository":2868,"state":2870,"title":2935,"updated_at":2936,"url":2937,"score":2938},"Error introduced in 4.0.6\r\nReverting to 4.0.5 is OK\r\n\r\nERROR in ./node_modules/@vueuse/core/dist/index.d.ts(4,10): 4:10 Module '\"../../../vue/types\"' has no exported member 'Ref'. Did you mean to use 'import Ref from \"../../../vue/types\"' instead?\r\n 2 | export * from '@vueuse/shared';\r\n 3 | import { Ref, Vue, UnwrapRef, ComputedRef, WritableComputedRef } from 'vue-demi';\r\n > 4 | import { Ref as Ref$1 } from 'vue';",[],291,"Compile error with 4.0.6 Module '\"../../../vue/types\"' has no exported member 'Ref'","2021-01-15T11:48:05Z","https://github.com/vueuse/vueuse/issues/291",0.7036453,{"description":2940,"labels":2941,"number":2942,"owner":2868,"repository":2868,"state":2870,"title":2943,"updated_at":2944,"url":2945,"score":2946},"package.json\r\n\r\n```json\r\n{\r\n \"scripts\": {\r\n \"build\": \"vite build\",\r\n \"dev\": \"vite\"\r\n },\r\n \"dependencies\": {\r\n \"@vueuse/components\": \"^7.6.0\",\r\n \"@vueuse/core\": \"^4.0.8\",\r\n \"vue\": \"^3.0.5\"\r\n },\r\n \"devDependencies\": {\r\n \"@vitejs/plugin-vue\": \"^1.0.6\",\r\n \"@vue/compiler-sfc\": \"^3.0.5\",\r\n \"typescript\": \"^4.1.3\",\r\n \"vite\": \"^2.0.0-beta.30\"\r\n }\r\n}\r\n```\r\n\r\n\r\n",[],1237,"Module @vueuse/core has no exported member useWebNotification","2022-02-10T15:17:29Z","https://github.com/vueuse/vueuse/issues/1237",0.7038708,["Reactive",2948],{},["Set"],["ShallowReactive",2951],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fJ9yCUgprnfvlJSd-ioEy6s67RHzd7kbYU-uAEOfLJYg":-1},"/vueuse/vue-demi/149"]