Illegal invocation from getBattery call
See original GitHub issueNot 100% sure if this is actually an issue within this project, but though I would ask if someone happens to have some information on this.
Summary
Affected platform: web
Version | 6.2.1 |
Affected OS | all |
OS Version | No pattern |
Current behavior
Some users apparently receive TypeError: Failed to execute 'getBattery' on 'Navigator': Illegal invocation.
This is coming from react-native-device-info/lib/module/web/index.js in init
.
I did some research and error would indicate that the call is missing context (for navigator object), but based on code I have no idea how this could be. Perhaps the call should be prefixed with window.
?
So far we have had 156 users getting this error, so it seems pretty common although it does not happen to me.
Expected behavior
If getBattery call is found from navigator, call should not give error and no call should happen if method is not supported.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:17 (2 by maintainers)
Top GitHub Comments
@Njaah-0 for me its yandex metrika: https://mc.yandex.ru/metrika/tag.js
It would seem that my patch based on https://github.com/react-native-device-info/react-native-device-info/pull/1333 didn’t affect the error appearance rate, it’s still happening.