\r\n | ^\r\n 2 | import { Ref, WatchStopHandle, ComputedRef, WatchOptions } from 'vue-demi';\r\n 3 | import { Ref as Ref$1, UnwrapRef, WatchStopHandle as WatchStopHandle$1, ComputedRef as ComputedRef$1 } from 'vue-demi';\r\n 4 | export * from '@vueuse/shared';\r\nERROR in .../node_modules/@vueuse/core/dist/index.d.ts(377,87):\r\n377:87 Cannot find name 'ResizeObserverCallback'.\r\n 375 | declare function useRefHistory\u003CRaw, Serialized = Raw>(current: Ref\u003CRaw>, options?: UseRefHistoryOptions\u003CRaw, Serialized>): UseRefHistoryReturn\u003CRaw, Serialized>;\r\n 376 | \r\n > 377 | declare function useResizeObserver(el: Ref\u003CHTMLElement | null | undefined>, callback: ResizeObserverCallback): {\r\n | ^\r\n 378 | stop: WatchStopHandle$1;\r\n 379 | };\r\n 380 | \r\nVersion: typescript 4.0.3\r\n```",[],154,"Typescript error on ResizeObserver","2020-11-03T06:27:49Z","https://github.com/vueuse/vueuse/issues/154",0.68855506,{"description":2941,"labels":2942,"number":2943,"owner":2868,"repository":2869,"state":2870,"title":2944,"updated_at":2945,"url":2946,"score":2947},"Hello @antfu,\r\n\r\nI am facing a strange issue while using `v6.0 ` of the `vue-demi` package in my project. I have a global 'store' which can also be accessed outside of the Vue-context (e.g. in `main.ts`). The `Vue.use(VueCompositionApi)` call is made before calling any composition-api related functions.\r\n\r\n```javascript\r\nimport { computed, reactive } from \"@vue/composition-api\"\r\nimport { toReadonlyState } from \"@/utils/composition\"\r\n\r\ninterface GeneralStore {\r\n token: string | null\r\n isAuthenticated: boolean\r\n isTranslationPresent: boolean\r\n translationError: boolean\r\n}\r\n\r\nconst state = reactive\u003CGeneralStore>({\r\n token: null,\r\n isAuthenticated: false,\r\n isTranslationPresent: false,\r\n translationError: false,\r\n})\r\n\r\nexport function useGeneralStore() {\r\n const mutations = {\r\n setToken: (token?: string) => {\r\n state.token = token ?? null\r\n },\r\n setIsAuthenticated: (isAuthenticated: boolean) => {\r\n state.isAuthenticated = isAuthenticated\r\n },\r\n setIsTranslationPresent: (isTranslationPresent: boolean) => {\r\n state.isTranslationPresent = isTranslationPresent\r\n },\r\n setTranslationError: (translationError: boolean) => {\r\n state.translationError = translationError\r\n },\r\n }\r\n\r\n return {\r\n ...toReadonlyState(state),\r\n ...mutations,\r\n }\r\n}\r\n\r\n```\r\n\r\nAfter upgrading vue-demi to `v6.0` the whole Vue2 application crashes on load with the following error:\r\n\r\n```\r\nUncaught TypeError: Cannot read property 'observable' of undefined\r\n at ht (vue-composition-api.esm.js:563)\r\n ah gt (vue-composition-api.esm.js:673)\r\n ...\r\n```\r\n\r\nIt seems Vue is undefined here...\r\n\r\n```javascript\r\n// vue-composition-api.esm.js\r\nfunction reactive(obj) {\r\n if ((process.env.NODE_ENV !== 'production') && !obj) {\r\n warn('\"reactive()\" is called without provide an \"object\".');\r\n // @ts-ignore\r\n return;\r\n }\r\n if (!(isPlainObject(obj) || isArray(obj)) ||\r\n isRaw(obj) ||\r\n !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n var observed = observe(obj); // FIXME: this call crashes due to Vue = undefined (line 673)\r\n setupAccessControl(observed);\r\n return observed;\r\n}\r\n```\r\n\r\n```javascript\r\n// vue-composition-api.esm.js\r\nfunction observe(obj) {\r\n var Vue = getRegisteredVueOrDefault();\r\n var observed;\r\n if (Vue.observable) { // FIXME: Vue is undefined here (line 563)\r\n observed = Vue.observable(obj);\r\n }\r\n else {\r\n var vm = defineComponentInstance(Vue, {\r\n data: {\r\n $$state: obj,\r\n },\r\n });\r\n observed = vm._data.$$state;\r\n }\r\n // in SSR, there is no __ob__. Mock for reactivity check\r\n if (!hasOwn(observed, '__ob__')) {\r\n def(observed, '__ob__', mockObserver(observed));\r\n }\r\n return observed;\r\n}\r\n```",[],28,"[v.6.0] Vue undefined while using reactive","2021-01-17T12:08:44Z","https://github.com/vueuse/vue-demi/issues/28",0.6913928,{"description":2949,"labels":2950,"number":2951,"owner":2868,"repository":2869,"state":2870,"title":2952,"updated_at":2953,"url":2954,"score":2955},"## Issue\r\nMy app breaks when adding any library that has `vue-demi` as a dependency, as it adds `@vue/composition-api` code to the final bundle, although I declared `@vue/composition-api` as external.\r\n\r\nI resolve `@vue/composition-api` in an UMD/AMD environment automatically. Because there are two instances of `@vue/composition-api` present, the app breaks.\r\n\r\n```ts\r\n// relevant vite.config.ts\r\n\r\nbuild: {\r\n rollupOptions: {\r\n external: [\r\n 'vue',\r\n '@vue/composition-api'\r\n ],\r\n }\r\n}\r\n```\r\n\r\n## Repro\r\n* Create a vue 2 app,\r\n* add `@vue/composition-api` and `@vueuse/core`\r\n* import any function from e.g. `@vueuse/core`\r\n* declare `@vue/composition-api` as external\r\n* run npx vite build\r\n* parts of `@vue/composition-api` end up in the bundle.\r\n\r\nAlso see this repro: https://github.com/johannes-z/vue-demi-repro. See https://github.com/johannes-z/vue-demi-repro/blob/main/dist/mylib.js#L1014",[],151,"vue-demi adds @vue/composition-api to bundle, even if it is declared as external","2022-07-15T00:37:38Z","https://github.com/vueuse/vue-demi/issues/151",0.6918804,["Reactive",2957],{},["Set"],["ShallowReactive",2960],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$feKmfbmPMUaWU57oSw6Lh0qRDnDnCqHEjPaZOYkkiMiA":-1},"/vueuse/vue-demi/6"]