Subscribe on changes!

Watch function does not work after packaging

avatar
Mar 27th 2022

Version

3.2.25

Reproduction link

https://github.com/HassaanAkbar/vue-zoomable/

Steps to reproduce

  1. Clone the repository.
  2. Run npm run dev. Demo works fine.
  3. Run npm run build and npm pack.
  4. Use the packed library in a new project (example usage: src/demos/Demo1.vue). Watcher does not work.

What is expected?

Watchers should keep working in a packaged library.

What is actually happening?

Watchers stop working.


I am working on a zoom and panning library. It uses watch function on a computed property and updates CSS styles on change. Watcher reference: https://github.com/HassaanAkbar/vue-zoomable/blob/main/src/components/VueZoomable.vue#L90

avatar
Mar 27th 2022

Issue was related to #5327 It's resolved after changing,

import { computed, ref } from '@vue/reactivity';

to

import { computed, ref } from 'vue';