joshwcomeau / use-sound

A React Hook for playing sound effects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React + Vite: TypeError: HowlConstructor.current is not a constructor

rostyslavDoskochynskiy opened this issue · comments

Hey guys. I have moved my react project from CRA to Vite and I have next error what you see on screenshot

I've read this issue, but this fix didn't help to resolve it.
Please let me know, how it can be fixed, otherwise I will have to rebuild significant amount of code.

Screenshot 2022-05-04 at 17 56 36

Screenshot 2022-05-04 at 17 56 29

I'm also seeing this issue. Looks like the fix hasn't been released yet.

The code should look like this https://github.com/joshwcomeau/use-sound/blob/master/src/index.ts#L42

image

But I see

image

You can use https://www.npmjs.com/package/@viveljs/use-sound as a workaround until the creator releases the fix