\r\nimport { defineConfig } from 'vite'\r\nimport vue from '@vitejs/plugin-vue'\r\nimport vueI18n from '@intlify/vite-plugin-vue-i18n'\r\n\r\n// https://vitejs.dev/config/\r\nconst path = require(\"path\")\r\nexport default defineConfig({\r\n test: {\r\n setupFiles: ['./tests/config.ts']\r\n },\r\n optimizeDeps: {\r\n exclude: ['vue-demi']\r\n },\r\n build: {\r\n lib: {\r\n entry: path.resolve(__dirname, 'src/install.ts'),\r\n name: 'vcp',\r\n formats: ['umd'],\r\n fileName: (format) => `vcp.${format}.ts`\r\n },\r\n rollupOptions: {\r\n external: ['vue', 'vueI18n', 'vue-demi',],\r\n output: {\r\n exports: 'named',\r\n globals: {\r\n 'vue-demi': 'VueDemi',\r\n 'vue': 'Vue',\r\n }\r\n }\r\n },\r\n },\r\n plugins: [\r\n vue({\r\n style: true,\r\n css: true\r\n }),\r\n vueI18n({\r\n include: path.resolve(__dirname, 'src/assets/translations.ts'),\r\n globalSFCScope: true,\r\n compositionOnly: false,\r\n }),\r\n ],\r\n server: {\r\n port: 8080\r\n },\r\n resolve: {\r\n dedupe: ['vue'],\r\n alias: {\r\n \"~\": path.resolve(__dirname, \"./src\"),\r\n \"@\": path.resolve(__dirname, \"./src\"),\r\n },\r\n },\r\n})\r\n\r\n```\r\n\r\npackage.json:\r\n```\r\n{\r\n \"name\": \"vcp\",\r\n \"version\": \"0.9.14\",\r\n \"private\": false,\r\n \"author\": \"Alireza Safari \u003Calireza.safaree@gmail.com> (http://alireza-safari.ir)\",\r\n \"license\": \"MIT\",\r\n \"main\": \"./dist/vcp.umd.ts\",\r\n \"description\": \"Vue Client Print with Template Builder\",\r\n \"exports\": {\r\n \".\": {\r\n \"require\": \"./dist/vcp.umd.ts\"\r\n },\r\n \"./dist/style.css\": \"./dist/style.css\"\r\n },\r\n \"keywords\": [\r\n \"vcp\",\r\n \"vue print\",\r\n \"vue client print\",\r\n \"template builder\",\r\n \"vue report\",\r\n \"vue report generator\"\r\n ],\r\n \"files\": [\r\n \"dist/*\"\r\n ],\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/alireza0sfr/vue-client-print\"\r\n },\r\n \"scripts\": {\r\n \"dev\": \"vite\",\r\n \"build\": \"vite build\",\r\n \"serve\": \"vite preview\",\r\n \"test\": \"vitest run --environment jsdom\",\r\n \"test:ui:\": \"vitest --environment jsdom --ui\",\r\n \"test:coverage\": \"vitest run --coverage --environment jsdom\",\r\n \"test:watch\": \"vitest --environment jsdom\"\r\n },\r\n \"dependencies\": {\r\n \"dom-to-image\": \"^2.6.0\",\r\n \"file-saver\": \"^2.0.5\",\r\n \"jsdom\": \"^19.0.0\",\r\n \"print-js\": \"^1.6.0\",\r\n \"register-service-worker\": \"^1.7.2\",\r\n \"typescript\": \"^4.7.2\",\r\n \"vitest\": \"^0.12.9\",\r\n \"vue-demi\": \"^0.12.5\",\r\n \"vue-i18n\": \"^9.1.10\"\r\n },\r\n \"peerDependencies\": {\r\n \"vue\": \">=2.0.0 || >=3.0.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@intlify/vite-plugin-vue-i18n\": \"^3.4.0\",\r\n \"@vitejs/plugin-vue\": \"^2.3.3\",\r\n \"@vitest/ui\": \"^0.12.9\",\r\n \"@vue/compiler-sfc\": \"^3.2.36\",\r\n \"@vue/test-utils\": \"^2.0.0-rc.18\",\r\n \"c8\": \"^7.11.3\",\r\n \"cz-conventional-changelog\": \"^3.0.1\",\r\n \"vite\": \"^2.9.9\",\r\n \"vue\": \"^3.2.36\"\r\n }\r\n}\r\n\r\n```",[],161,"createElementVNode is not a function vite","2022-10-27T15:14:22Z","https://github.com/vueuse/vue-demi/issues/161",0.7473669,{"description":3035,"labels":3036,"number":3037,"owner":3019,"repository":3020,"state":3021,"title":3038,"updated_at":3039,"url":3040,"score":3041},"I have developed my library using Vue 2.7 and vue-demi with Vite. I am able to consume the library in Vue 2.7 and everything is working fine but not in Vue 3.\r\n\r\nAs soon as I use any of the components from my library, I get below errors in browser console and my components are not instantiated/mounted.\r\n\r\n\r\n\r\nIt seems Vue 3 does not work well with Vue 2. But then what is the point of using vue-demi?\r\n\r\nThe workaround that I have been trying is to publish two separate packages for each version with below scripts:\r\n\r\n```\r\n\"scripts\": {\r\n \"dev\": \"vite\",\r\n \"build:2\": \"vue-demi-switch 2 vue2 && run-p build-only build:styles\",\r\n \"build:3\": \"vue-demi-switch 3 && run-p build-only build:styles\",\r\n.......\r\n}\r\n```\r\n\r\nNow when I try to build for Vue 2, it throws below error:\r\n\r\n```\r\n[vite:vue2] source.startsWith is not a function\r\nfile: /Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/src/components/audio/AudioPlayer/AudioPlayer.vue\r\nerror during build:\r\nTypeError: source.startsWith is not a function\r\n at startsWith (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:1420:17)\r\n at isEnd (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:1457:11)\r\n at parseChildren (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:795:11)\r\n at Object.baseParse (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:769:5)\r\n at Object.parse (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js:2956:23)\r\n at Object.parse$2 [as parse] (/Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:1198:24)\r\n at createDescriptor (file:///Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vitejs/plugin-vue2/dist/index.mjs:68:27)\r\n at transformMain (file:///Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vitejs/plugin-vue2/dist/index.mjs:755:34)\r\n at Object.transform (file:///Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/@vitejs/plugin-vue2/dist/index.mjs:1104:16)\r\n at file:///Users/amitchaudhary/Desktop/D/Projects/Mindvalley/mv_universal_player/mv-universal-player/node_modules/rollup/dist/es/shared/node-entry.js:24656:40\r\n\r\n```\r\n\r\nPlease let me know what I should do.\r\n\r\n\r\n\r\n\r\n\r\n",[],237,"Can't use Vue 2 library in Vue 3","2023-07-27T00:50:29Z","https://github.com/vueuse/vue-demi/issues/237",0.7483178,{"description":3043,"labels":3044,"number":3045,"owner":3019,"repository":3020,"state":3046,"title":3047,"updated_at":3048,"url":3049,"score":3050},"demo: \r\n[https://github.com/jackson-yyy/vue-demi-bug-demo](url)\r\n\r\n## reproduce steps\r\n\r\n1. run `pnpm install`\r\n2. check `node_modules/lib/v3/index.cjs`, it is correct.\r\n```javascript\r\nvar Vue = require('vue')\r\n\r\nObject.keys(Vue).forEach(function(key) {\r\n exports[key] = Vue[key]\r\n})\r\n```\r\n3. run `pnpm switch:vue2`\r\n4. check `node_modules/lib/v3/index.cjs`, it becomes the source code of v2. it shouldn't be changed.\r\n```javascript\r\nvar Vue = require('vue')\r\nvar VueCompositionAPI = require('@vue/composition-api')\r\n```\r\n\r\ni think it's the problem of pnpm. It use symbol link to link file.\r\n\r\ni try to delete files under lib before writing file\r\n\r\n```diff\r\nfunction copy(name, version, vue) {\r\n vue = vue || 'vue'\r\n const src = path.join(dir, `v${version}`, name)\r\n const dest = path.join(dir, name)\r\n let content = fs.readFileSync(src, 'utf-8')\r\n content = content.replace(/'vue'/g, `'${vue}'`)\r\n+ fs.unlinkSync(dest)\r\n fs.writeFileSync(dest, content, 'utf-8')\r\n}\r\n```\r\n\r\nit works perfectly now.",[],92,"closed","bug of switching vue version with pnpm","2021-08-14T07:46:54Z","https://github.com/vueuse/vue-demi/issues/92",0.7306729,{"description":3052,"labels":3053,"number":3054,"owner":3019,"repository":3019,"state":3046,"title":3055,"updated_at":3056,"url":3057,"score":3058},"",[],1072,"When importing using pnpm Module '\"@vueuse/core\"' has no exported member 'toReactive'.","2022-01-03T09:46:55Z","https://github.com/vueuse/vueuse/issues/1072",0.73164415,{"description":3060,"labels":3061,"number":3062,"owner":3019,"repository":3020,"state":3046,"title":3063,"updated_at":3064,"url":3065,"score":3066},"Hi. In the README.md, there is a section that says if postinstall is missed, you can run `npx vue-demi-fix` \r\n\r\nbut I can't, and it fails:\r\n\r\n",[],246,"vue-demi-fix is missing","2023-09-29T07:20:27Z","https://github.com/vueuse/vue-demi/issues/246",0.738502,{"description":3068,"labels":3069,"number":3070,"owner":3019,"repository":3020,"state":3046,"title":3071,"updated_at":3072,"url":3073,"score":3074},"`import {ref, isVue2} from 'vue-demi';`\n\n`isVue2` always returns false when it should be true for Vue 2.7\n\n\n`\"vue\": \"2.7.11\",\n \"vue-demi\": \"0.14.10\"`\n\n`pnpm 10.6.5`\n\nbut `isVue2` will return true in `pnpm 9.6.0`\n \n",[],273,"isvue2 doesn't work in pnpm 10.6.5","2025-06-15T00:09:32Z","https://github.com/vueuse/vue-demi/issues/273",0.74051434,{"description":3076,"labels":3077,"number":3081,"owner":3019,"repository":3019,"state":3046,"title":3082,"updated_at":3083,"url":3084,"score":3085},"### Describe the bug\n\nBUG | `useVModel` | Not working with vue2.7 `\u003Cscritp setup>`\n\nParent component\n```js\n// src/views/AboutView.vue\n\n\u003Cscript setup>\nimport {reactive, ref} from \"vue\";\nimport TestModel from \"@/components/TestModel.vue\";\n\nconst state = reactive({\n show: false,\n});\n\n// passing this as v-model also doesn't work\n// const re = ref(false)\n\n\u003C/script>\n\n\u003Ctemplate>\n \u003Cdiv>\n \u003Cdiv class=\"about\">\n \u003Cbutton @click=\"state.show = !state.show\">Show: {{ state.show ? \"Y\" : \"N\" }}\u003C/button>\n\n \u003CTestModel\n v-model=\"state.show\"\n />\n \u003C/div>\n \u003C/div>\n\u003C/template>\n\n\u003Cstyle>\n@media (min-width: 1024px) {\n .about {\n min-height: 100vh;\n display: flex;\n align-items: center;\n gap: 1rem;\n }\n}\n\u003C/style>\n\n```\nChild component\n```js\n// src/components/TestModel.vue\n\n\u003Cscript setup>\nimport {onMounted, watch} from \"vue\";\nimport {useVModel} from \"@vueuse/core\";\n\nconst props = defineProps({\n modelValue: {\n type: Boolean\n }\n});\n\nconst emit = defineEmits([\"update:modelValue\"]);\n\nconst data = useVModel(props, 'modelValue', emit, {\n deep: true,\n});\n\n// watch(() => data.value, (v) => {\n// if (v) {\n// setTimeout(() => {\n// data.value = false;\n// }, 2000)\n// }\n// })\n//\n// onMounted(() => {\n// setTimeout(() => {\n// console.log('update model value')\n// data.value = true;\n// }, 4000)\n// })\n\n\u003C/script>\n\n\u003Ctemplate>\n\u003Cdiv>\n \u003Ch1>model? {{data ? 'YES' : 'NO'}}\u003C/h1>\n \u003Ch1>props.modelValue ? {{props.modelValue ? 'YES' : 'NO'}}\u003C/h1>\n\u003C/div>\n\u003C/template>\n\n\u003Cstyle scoped>\n\n\u003C/style>\n```\n\n**Note:** on the reproduction link, go to *About* page & click on the button. You'll see that the child component is not picking the update. \n\nFYI: the project was setup using `pnpm create vue@legacy`, so this is a `vite` project.\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/serene-fermi-jkd885\n\n### System Info\n\n```Shell\nSystem:\n OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)\n CPU: (8) x64 Intel(R) Core(TM) i3-14100\n Memory: 20.57 GB / 31.03 GB\n Container: Yes\n Shell: 5.2.21 - /bin/bash\n Binaries:\n Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node\n npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm\n pnpm: 9.15.0 - ~/.local/share/pnpm/pnpm\n Browsers:\n Brave Browser: 132.1.74.48\n Chrome: 132.0.6834.83\n npmPackages:\n @vueuse/core: ^11.3.0 => 11.3.0 \n vue: ^2.7.16 => 2.7.16\n```\n\n### Used Package Manager\n\npnpm\n\n\n### Discussion link\nhttps://github.com/vueuse/vueuse/discussions/4507\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.",[3078],{"name":3079,"color":3080},"has workaround","4260B0",4506,"BUG | `useVModel` | Not working with vue2.7 `\u003Cscritp setup>`","2025-01-24T03:44:13Z","https://github.com/vueuse/vueuse/issues/4506",0.74111706,{"description":3087,"labels":3088,"number":3089,"owner":3019,"repository":3019,"state":3046,"title":3090,"updated_at":3091,"url":3092,"score":3093},"### Describe the bug\n\nusing options (UseElementBoundingOptions) on method useElementBounding does nothing, I am using options\r\n\r\n- windowResize?: boolean;\r\n- windowScroll?: boolean;\r\n\r\n---\r\n\r\nSample code\r\n```javascript\r\nconst { width, height } = useElementBounding(target, {\r\n windowResize: false,\r\n windowScroll: false,\r\n});\r\n```\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vitejs-vite-9vgjun/?file=src%2FApp.vue\n\n### System Info\n\n```Shell\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor \r\n Memory: 33.76 GB / 47.95 GB\r\n Binaries:\r\n Node: 19.7.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.5.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 8.7.0 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Spartan (44.22621.2134.0), Chromium (116.0.1938.62)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n @vueuse/core: ^10.4.0 => 10.4.0 \r\n @vueuse/nuxt: ^10.4.0 => 10.4.0\n```\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.",[],3357,"useElementBounding options are ignored","2023-11-13T20:37:18Z","https://github.com/vueuse/vueuse/issues/3357",0.74304587,{"description":3095,"labels":3096,"number":3097,"owner":3019,"repository":3019,"state":3046,"title":3098,"updated_at":3099,"url":3100,"score":3101},"I am not able to import any packages. I've tried useTitle and useDebounce. I have just setup the latest version of vue3 and vueuse. \r\n\r\n**Error**\r\nFailed to compile.\r\n\r\n./node_modules/@vueuse/core/index.mjs 953:50-62\r\nCan't import the named export 'bypassFilter' from non EcmaScript module (only default export is available)\r\n\r\n**Versions**\r\n\"@vueuse/core@^6.3.3\":\r\nvue@^3.0.0:\r\n version \"3.2.10\"\r\nnode: 14.17.6",[],743," error in ./node_modules/@vueuse/core/index.mjs Can't import the named export 'bypassFilter' from non EcmaScript module (only default export is available)","2021-09-14T02:37:26Z","https://github.com/vueuse/vueuse/issues/743",0.7497852,["Reactive",3103],{},["Set"],["ShallowReactive",3106],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fCC8tFXM8mIYnJcKXolsHjKvKv4BXAAJD9ExL7GCQj30":-1},"/vueuse/vue-demi/261"]