-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read properties of undefined (reading '0') at Howl.rate #125
Comments
I'm getting the same error. |
I'm also experiencing this error, though only when I use sprites. |
This was driving me bananas, I tried a few things, and this ended up solving it - I wrapped the state-controlled volume variable in a ref. I'm not exactly sure why that helped - but now it doesn't throw the exception when changing the volume variable.
|
When I do this and add logic to update the ref when volume changes, it errors-out again. |
When having a variable set the volume of the useSound hook, sometimes changing the variable changes the volume, but sometimes it throws this error:
Uncaught TypeError: Cannot read properties of undefined (reading '0')
at Howl.rate (howler.js:1564:1)
at index.ts:94:1
at commitHookEffectListMount (react-dom.development.js:23150:1)
at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
at commitPassiveMountEffects (react-dom.development.js:24866:1)
at flushPassiveEffectsImpl (react-dom.development.js:27039:1)
at flushPassiveEffects (react-dom.development.js:26984:1)
at commitRootImpl (react-dom.development.js:26935:1)
"volume" is a useState variable. But if I make it a normal variable and change the value of it it gives me the same error. The error message seems to be about the "rate". I have tried setting a playbackrate but it did not resolve the issue. The error appears when the "volume" variable changes, but not every time. When logging the type of the "volume" variable before the declaration of the useSound hook, it returns "number", not "undefined".
The text was updated successfully, but these errors were encountered: