Uncaught TypeError: Cannot set property 'volume' of null #23664
Labels
Bug
Platform: Android
Android applications.
Stale
There has been a lack of activity on this issue and it may be closed soon.
The debugger-ui crashes and then doesn't output the proper output, such as console.log statements put into code.
To Reproduce
It appears that the code is trying to get a reference to an audio component that is supposed to be loaded on the page. The problems is that the element is obviously not loaded at the time the code is trying to get the reference. This can be seen in the fact that once the code is allows to execute past the exception, the element is loaded and can be referenced.
So, clearly the issue is that the code is trying to access the element too soon as not all elements are loaded yet. This seems to be closely linked with the chrome extensions that are running. Here are mine.
You will notice I only have one loaded in the picture. I usually have more loaded, but I was trying to see which one was conflicting with the code. The problem I found was that it is any of them, potentially. For some reason, they can slow down the loading of the audio element the code is trying to reference.
The confusing thing is, different extensions will have different effects. Some will always cause the error. Others won't. Still others will cause the error some of the time while not others. With the extension shown, the code would break half the time after each refresh.
Not sure how you can fix this, but as the issue has been brought up many times before, I think we can say it hasn't been fixed. At least, put a check into the code to make sure it has go the reference it wants to the audio element. Maybe a setTimeout can be used if it fails to get it, or at least it can safely skips that portion as it doesn't seem to be vital to the program.
Expected Behavior
That the debugger would load and run properly despite how many chrome extensions are loaded. Seems silly to have to shut down all ones extensions because the debugger can't safely get a reference to an audio element.
Code Example
System Setup
React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
Memory: 2.43 GB / 7.91 GB
Binaries:
Yarn: 1.13.0 - C:\Users\SURFACE\AppData\Roaming\npm\yarn.CMD
npm: 6.7.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338
The text was updated successfully, but these errors were encountered: