\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.7098608,{"description":2873,"labels":2874,"number":2875,"owner":2857,"repository":2857,"state":2876,"title":2877,"updated_at":2878,"url":2879,"score":2880},"### Describe the bug\r\n\r\nIt seems when in vue3 project, it still import vue-demi.\r\n\r\nWhen i down to 8.9.3, problem solved.\r\n\r\n```\r\n10:14:49 AM [vite] Internal server error: Failed to resolve import \"vue-demi\" from \"node_modules/.vite/deps/chunk-KBM4AKY4.js?v=49be3b31\". Does the file exist?\r\n Plugin: vite:import-analysis\r\n File: /Users/alex.xie/code/divzen-web/node_modules/.vite/deps/chunk-KBM4AKY4.js?v=49be3b31\r\n 1 | // node_modules/.pnpm/@vueuse+shared@8.9.4_vue@3.2.37/node_modules/@vueuse/shared/index.mjs\r\n 2 | import { shallowRef, watchEffect, readonly, ref, unref, isVue3, watch, customRef, effectScope, provide, inject, getCurrentScope, onScopeDispose, 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\n 3 | var __defProp$9 = Object.defineProperty;\r\n 4 | var __defProps$6 = Object.defineProperties;\r\n```\r\n\r\n### Reproduction\r\n\r\ni may put it later\r\n\r\n### System Info\r\n\r\n```Shell\r\nSystem:\r\n OS: macOS 12.4\r\n CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz\r\n Memory: 499.36 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node\r\n Yarn: 1.22.17 - ~/.yarn/bin/yarn\r\n npm: 8.5.5 - ~/.config/yarn/global/node_modules/.bin/npm\r\n Browsers:\r\n Chrome: 103.0.5060.114\r\n Firefox: 89.0\r\n Safari: 15.5\r\n npmPackages:\r\n @vueuse/core: 8.9.4 => 8.9.4 \r\n vue: ^3.2.37 => 3.2.37\r\n```\r\n\r\n\r\n### Used Package Manager\r\n\r\npnpm\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://github.com/vueuse/vueuse/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/vueuse/vueuse/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://vueuse.org/guide).\r\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.\r\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.\r\n- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vueuse/vueuse/discussions).\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[],1953,"closed","v8.9.4 will break vue3 project?","2022-07-19T05:57:43Z","https://github.com/vueuse/vueuse/issues/1953",0.66592467,{"description":2882,"labels":2883,"number":2884,"owner":2857,"repository":2857,"state":2876,"title":2885,"updated_at":2886,"url":2887,"score":2888},"### Describe the bug\r\n\r\n目录结构:\r\n```\r\npackages:\r\n + A\r\n + + package.json -> start:vite\r\n + + vite.config.ts\r\n\r\npackage.json -> start: vite packages/A\r\n```\r\n\r\n我在A项目引入的@vueuse/core包,\r\n然后在vite.config.ts中搭配AutoImport使用它:\r\n```\r\nAutoImport({\r\n\t\t\t\timports: ['vue', '@vueuse/core'],\r\n\t\t\t}),\r\n```\r\n这样的配置,我在A目录下pnpm run start启动是正常的,\r\n\r\n但是在根目录下启动pnpm run start命令会报错:\r\nTypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string or an instance of Buffer or URL. Received undefined\r\nError: [auto-import] failed to load @vueuse/core, have you installed it?\r\n\r\n我此时必须要在根目录下引入@vueuse/core才行。\r\n或者自动导入不要加入@vueuse/core:\r\n```\r\nAutoImport({\r\n\t\t\t\timports: ['vue'],\r\n\t\t\t}),\r\n```\r\n这就是我奇怪的地方,vue也是安装在A里面,为啥自动导入vue不报错,导入vueuse就报错。\r\n另外,我启动的是vite packages/A,它不会自己找到A里面的@vueuse/core吗?\r\n\r\n### Reproduction\r\n\r\n在生产\r\n\r\n### System Info\r\n\r\n```Shell\r\nnode - v:20.11.0\r\npnpm -v:9.0.6\r\n```\r\n\r\n\r\n### Used Package Manager\r\n\r\npnpm\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://github.com/vueuse/vueuse/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/vueuse/vueuse/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://vueuse.org/guide).\r\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.\r\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.\r\n- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vueuse/vueuse/discussions).\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[],3959,"Monorepo架构下,跟目录下启动子项目报错:Error: [auto-import] failed to load @vueuse/core, have you installed it?","2024-05-08T10:42:04Z","https://github.com/vueuse/vueuse/issues/3959",0.6817104,{"description":2890,"labels":2891,"number":2892,"owner":2857,"repository":2857,"state":2876,"title":2893,"updated_at":2894,"url":2895,"score":2896},"我的项目依赖如下:\r\n`\r\n\"dependencies\": {\r\n \"@vue/composition-api\": \"^1.2.4\",\r\n \"@vueuse/core\": \"^5.0.3\",\r\n \"axios\": \"^0.21.1\",\r\n \"core-js\": \"^3.6.5\",\r\n \"dayjs\": \"^1.10.5\",\r\n \"element-ui\": \"^2.15.3\",\r\n \"optimize-css-assets-webpack-plugin\": \"^6.0.1\",\r\n \"progressive-image\": \"^1.2.0\",\r\n \"vue\": \"^2.6.11\",\r\n \"vue-fragment\": \"^1.5.2\",\r\n \"vue-quill-editor\": \"^3.0.6\",\r\n \"vue-router\": \"^3.2.0\",\r\n \"vuex\": \"^3.4.0\"\r\n }\r\n`\r\n页面中的响应式数据会失效,甚至异步请求回来的数据也不能正常显示在页面上,我的项目里用到了`useCssVar, useDebounce, useVModel`这三个方法,当然这三个方法也是都失效的,我查看了一下yarn.lock里依赖的版本,发现vue-demi的版本是0.11.4,然后当我把vue-demi的版本控制在0.10.0时,我的项目一切又恢复正常(useCssVar, useDebounce, useVModel都能正常使用,并且响应式数据正常)。\r\n\r\nvue-demi版本是0.11.4时页面是这样:\r\n\r\n\r\nvue-demi版本是0.10.0时页面是这样:\r\n\r\n\r\n希望作者大佬们帮我看一下这个issue\r\n",[],844,"@vueuse/core版本是5.0.3,它所依赖的vue-demi版本是0.11.4,引入vueuse/core里的方法后页面内的响应式数据都会失效","2021-10-19T06:38:36Z","https://github.com/vueuse/vueuse/issues/844",0.6832742,{"description":2898,"labels":2899,"number":2900,"owner":2857,"repository":2857,"state":2876,"title":2901,"updated_at":2902,"url":2903,"score":2904},"Not sure if it's a `@vueuse` issue\r\n\r\n# Environment\r\n\r\n- Operating System: Windows_NT\r\n- Node Version: v16.13.0\r\n- Nuxt Version: 3.0.0-27324955.23397e6\r\n- Element-Plus version: 1.2.0-beta.6\r\n- Package Manager: pnpm@6.24.1\r\n- Bundler: Vite\r\n- User Config: -\r\n- Runtime Modules: -\r\n- Build Modules: -\r\n\r\n# Reproduction\r\n\r\n```shell\r\ngit clone https://github.com/element-plus/element-plus-nuxt-starter.git\r\n\r\ncd element-plus-nuxt-starter\r\n\r\npnpm install\r\n\r\npnpm run dev\r\n\r\n# Browser access: http://localhost:3000\r\n```\r\n\r\ntouch `package.json`\r\n\r\n```json\r\n{\r\n \"private\": true,\r\n \"scripts\": {\r\n \"build\": \"nuxi build\",\r\n \"dev\": \"nuxi dev\",\r\n \"start\": \"node .output/server/index.mjs\",\r\n \"generate\": \"export NITRO_PRESET=browser && npm run build\"\r\n },\r\n \"dependencies\": {\r\n \"pinia\": \"^2.0.5\"\r\n },\r\n \"devDependencies\": {\r\n \"@pinia/nuxt\": \"^0.1.6\",\r\n \"element-plus\": \"1.2.0-beta.6\",\r\n \"nuxt3\": \"3.0.0-27324955.23397e6\",\r\n \"sass\": \"^1.44.0\",\r\n \"typescript\": \"^4.5.4\"\r\n },\r\n \"pnpm\": {\r\n \"overrides\": {\r\n \"@nuxt/kit\": \"npm:@nuxt/kit-edge@3.0.0-27324955.23397e6\",\r\n \"@nuxt/kit-edge\": \"3.0.0-27324955.23397e6\",\r\n \"@vueuse/core\": \"7.3.0\",\r\n \"@vueuse/shared\": \"7.3.0\"\r\n }\r\n }\r\n}\r\n```\r\n\r\n\r\n\r\n# Describe the bug\r\n\r\n```javascript\r\nUncaught Error: Dynamic require of \"vue-demi\" is not supported\r\n at chunk-EABY2BFN.js?v=9c4aff8c:26\r\n at node_modules/.pnpm/registry.npmmirror.com+@vueuse+shared@7.3.0/node_modules/@vueuse/shared/index.cjs (index.cjs:5)\r\n at __require2 (chunk-EABY2BFN.js?v=9c4aff8c:32)\r\n at node_modules/.pnpm/registry.npmmirror.com+@vueuse+core@7.3.0/node_modules/@vueuse/core/index.cjs (index.cjs:5)\r\n at __require2 (chunk-EABY2BFN.js?v=9c4aff8c:32)\r\n at node_modules/.pnpm/registry.npmmirror.com+element-plus@1.2.0-beta.6/node_modules/element-plus/lib/hooks/use-modal/index.js (aria.ts:178)\r\n at __require2 (chunk-EABY2BFN.js?v=9c4aff8c:32)\r\n at node_modules/.pnpm/registry.npmmirror.com+element-plus@1.2.0-beta.6/node_modules/element-plus/lib/hooks/index.js (index.js:12)\r\n at __require2 (chunk-EABY2BFN.js?v=9c4aff8c:32)\r\n at node_modules/.pnpm/registry.npmmirror.com+element-plus@1.2.0-beta.6/node_modules/element-plus/lib/make-installer.js (version.ts:1)\r\n```\r\n\r\n\r\n\r\n\r\n# Additional context\r\n\r\nNo response\r\n\r\n# Logs\r\n\r\nNo response",[],1069,"Uncaught Error: Dynamic require of \"vue-demi\" is not supported","2022-03-01T07:49:33Z","https://github.com/vueuse/vueuse/issues/1069",0.68755925,{"description":2906,"labels":2907,"number":2908,"owner":2857,"repository":2858,"state":2876,"title":2909,"updated_at":2910,"url":2911,"score":2912},"This is my dependency library\r\n\r\nWhen I start Vite, the following error occurs\r\n\r\nIs vue3.5.13 version supported?",[],268,"No matching export Error","2024-11-21T12:32:50Z","https://github.com/vueuse/vue-demi/issues/268",0.69442415,{"description":2914,"labels":2915,"number":2916,"owner":2857,"repository":2857,"state":2876,"title":2917,"updated_at":2918,"url":2919,"score":2920},"### Describe the bug\r\n\r\nIn our CI environment the following error occurs during `vite build`:\r\n\r\n```txt\r\n\"Fragment\" is not exported by \"node_modules/@vueuse/core/node_modules/vue-demi/lib/index.mjs\", imported by \"node_modules/@vueuse/core/index.mjs\".\r\nfile: /builds/.../node_modules/@vueuse/core/index.mjs:3:135\r\n1: import { noop, makeDestructurable, toValue, isClient, tryOnScopeDispose, isIOS, tryOnMounted, computedWithControl, isObject, objectOmit, promiseT...\r\n2: export * from '@vueuse/shared';\r\n3: import { isRef, ref, shallowRef, watchEffect, computed, inject, isVue3, version, defineComponent, h, TransitionGroup, shallowReactive, Fragment, ...\r\n ^\r\n4: \r\n5: function computedAsync(evaluationCallback, initialState, optionsOrRef) {\r\nerror during build:\r\nRollupError: \"Fragment\" is not exported by \"node_modules/@vueuse/core/node_modules/vue-demi/lib/index.mjs\", imported by \"node_modules/@vueuse/core/index.mjs\".\r\n```\r\n\r\nWhat seems odd to me is that the error message says it could not import from `vue-demi/lib/index.mjs`, but actually it should import from `vue-demi/lib/v2.7/index.mjs`.\r\n\r\n### Reproduction\r\n\r\n\r\n\r\n### System Info\r\n\r\n```Shell\r\nSystem:\r\n OS: Linux 5.4 Debian GNU/Linux 11 (bullseye) 11 (bullseye)\r\n CPU: (1) x64 Intel(R) Xeon(R) CPU @ 2.30GHz\r\n Memory: 2.85 GB / 3.60 GB\r\n Container: Yes\r\n Shell: 5.1.4 - /bin/bash\r\n Binaries:\r\n Node: 18.16.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.5.1 - /usr/local/bin/npm\r\n npmPackages:\r\n @vueuse/core: 10.0.2 => 10.0.2 \r\n vue: 2.7.14 => 2.7.14\r\n```\r\n\r\n\r\n### Used Package Manager\r\n\r\nnpm\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://github.com/vueuse/vueuse/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/vueuse/vueuse/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://vueuse.org/guide).\r\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.\r\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.\r\n- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vueuse/vueuse/discussions).\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[],3009,"RollupError: \"Fragment\" is not exported when updating to @vueuse/core 10.x","2023-05-03T09:38:53Z","https://github.com/vueuse/vueuse/issues/3009",0.69750935,{"description":2922,"labels":2923,"number":2924,"owner":2857,"repository":2857,"state":2876,"title":2925,"updated_at":2926,"url":2927,"score":2928},"Can't figure out why this error suddenly crashed my two vitepress projects. I've got vueuse v 4.7.0. The only thing I've done is installed `n` package and changed my node js version to v. 14. \r\n\r\n```\r\nvitepress v0.12.2\r\nvite v2.1.2\r\nfailed to start server. error:\r\n Error: Failed to resolve entry for package \"@vueuse/core\". The package may have incorrect main/module/exports specified in its package.json.\r\n ...\r\n ERROR Command failed with exit code 1.\r\n```\r\n`vueuse` is used only for dark mode toggle in the theme, so removing the buttons helps to revive my sites for now. Please, help me cope with this sudden break.",[],428,"Failed to resolve entry for package \"@vueuse/core\" error in my vitepress projects. ","2021-04-07T12:52:21Z","https://github.com/vueuse/vueuse/issues/428",0.6986683,{"description":2930,"labels":2931,"number":2932,"owner":2857,"repository":2858,"state":2876,"title":2933,"updated_at":2934,"url":2935,"score":2936},"i using CDN in my page:\r\n```\r\n\u003Cscript src=\"https://cdn.jsdelivr.net/npm/vue@2.6.14\">\u003C/script>\r\n\u003Cscript src=\"https://unpkg.com/vue-demi@0.12.1/lib/index.iife.js\">\u003C/script>\r\n\u003Cscript src=\"https://unpkg.com/vue-recaptcha@1.3.0/dist/vue-recaptcha.min.js\">\u003C/script>\r\n```\r\n\r\nbut:\r\n[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.\r\n\r\n\r\n",[],208,"CDN error: @vue/composition-api before vue-demi","2023-02-15T08:37:55Z","https://github.com/vueuse/vue-demi/issues/208",0.7032273,["Reactive",2938],{},["Set"],["ShallowReactive",2941],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fRtqIEBv_DCgF2sS4vTwmwjNd7rrb4ORLzAwRkq63dfI":-1},"/vueuse/vue-demi/116"]