shayneo / vue-fuse

https://vue-fuse-demo.netlify.com/
MIT License
314 stars 43 forks source link

importing bug #101

Open Emir507 opened 2 years ago

Emir507 commented 2 years ago

vue-fuse.es.js is not importing properties correctly

`./node_modules/vue-fuse/dist/vue-fuse.es.js`
...
import { ref, computed, watch } from "vue";
...

 warning  in ./node_modules/vue-fuse/dist/vue-fuse.es.js
"export 'computed' was not found in 'vue'

 warning  in ./node_modules/vue-fuse/dist/vue-fuse.es.js
"export 'ref' was not found in 'vue'

 warning  in ./node_modules/vue-fuse/dist/vue-fuse.es.js
"export 'watch' was not found in 'vue'

it works if i change 'vue' on 'vue-demi' manually in node_modules folder

what do I do?

jonadeline commented 2 years ago

same here

shayneo commented 2 years ago

@Emir507 @jonadeline what version of vue are y'all on?

Emir507 commented 2 years ago

@shayneo vue 2

shayneo commented 2 years ago

@Emir507 cool! do you have @vue/composition-api installed? it's required to use vue-fuse with vue 2

jonadeline commented 2 years ago

I tried the composition-api method but it wasn't successful. I finally ended up to import it this way in my component (within a nuxt project)

components: {
    VueFuse: () => {
      if (process.client) {
        // @ts-ignore
        return import('vue-fuse')
      }
    },
 }