sound icon indicating copy to clipboard operation
sound copied to clipboard

Not working with Vue3 & Vite3

Open ozgurozalp opened this issue 2 years ago • 8 comments

I only get the error in the image

image

ozgurozalp avatar Jul 31 '22 10:07 ozgurozalp

same problem

tunghsingw avatar Aug 22 '22 02:08 tunghsingw

same problem

mentalrob avatar Aug 26 '22 09:08 mentalrob

same problem

mirzobedil avatar Oct 24 '22 10:10 mirzobedil

same problem

HamasakiBrain avatar Oct 30 '22 23:10 HamasakiBrain

same problem

DanielMontilla avatar Nov 01 '22 19:11 DanielMontilla

Hey @ozgurozalp & @tunghsingw 🙂

I'm very sorry I took so long to answer and fix this issue!

Could you let me know if v2 fixed it for you? I successfully run it with latest Vite and Nuxt 3!

Tahul avatar Nov 25 '22 02:11 Tahul

When using a fresh Vite / Vue 3 app (created with Vite CLI). I get the error: HowlConstructor.value is not a constructor image

I forked and tried editing line 27 on index.ts from HowlConstructor.value = howler.Howl to HowlConstructor.value = howler.default.Howl, but then I get the same warning mentioned above

image

P-James avatar Nov 29 '22 17:11 P-James

After some more tinkering, importing onMounted from 'vue' instead of 'vue-demi' fixed the problem. Is this potentially a Vue bug? I thought they're meant to interact seamlessly 🤔

On index.ts line 2: import { onMounted, ref, unref, watch } from 'vue'

Edit: have made a PR with some more info https://github.com/vueuse/sound/pull/29

P-James avatar Nov 29 '22 17:11 P-James