_checkForConnectedDevices throw "TypeError: Illegal invocation"

We see quite often this error on new Scene in our tracking tool, but we can not reproduce it.

TypeError: Illegal invocation
  at _checkForConnectedDevices(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/DeviceInput/InputDevices/webDeviceInputSystem.js:177:38)
  at _enableEvents(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/DeviceInput/InputDevices/webDeviceInputSystem.js:143:18)
  at new e(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/DeviceInput/InputDevices/webDeviceInputSystem.js:36:14)
  at new e(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/DeviceInput/InputDevices/internalDeviceSourceManager.js:50:39)
  at new e(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/DeviceInput/InputDevices/deviceSourceManager.js:15:49)
  at attachControl(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/Inputs/scene.inputManager.js:435:37)
  at attachControl(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/scene.js:1522:28)
  at new t(webpack://egr-onlineplanner/./node_modules/@babylonjs/core/scene.js:665:19)
  • Browser is always Chrome (different versions 79, 80, 96, 97, 98)
  • OS always Windows 10
  • atm we use babylonjs/core 5.0.0-beta.9 but we saw the error already in our previous builds with 5.0.0-alpha.45
  • because i don’t see any changes to the _checkForConnectedDevices callback in babylonjs/core latest version i guess the error will continue to occure when we update

cc @PolygonalSun

@daniel-rabe can you repro in the playground ? I am wondering if it is related to one functionality in use in your code, or if it is more related to some environments. Would be awesome if you have a repro :slight_smile: