aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.66k stars 3.97k forks source link

Uncaught TypeError: navigator.xr.requestDevice is not a function with WebXR API Emulator #4268

Closed arpu closed 5 years ago

arpu commented 5 years ago

chrome stable 77 https://github.com/MozillaReality/WebXR-emulator-extension aframe master example https://a-frobot.github.io/aframe/examples/boilerplate/hello-world/

Uncaught TypeError: navigator.xr.requestDevice is not a function
    at Object.<anonymous> (device.js:21)
    at Object.173._process (device.js:150)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.176../bind (index.js:6)
    at s (_prelude.js:1)
    at _prelude.js:1
    at Object.149.../package (index.js:25)
    at s (_prelude.js:1)
    at e (_prelude.js:1)

@takahirox @dmarcos does this needs a aframe change or Emulator?

takahirox commented 5 years ago

See https://github.com/MozillaReality/WebXR-emulator-extension/issues/100

arpu commented 5 years ago

looks like something like this is needed in aframe https://github.com/MozillaReality/aframe/commit/cfe8fbb1c265cde4fbf500a9278fe48344b76562

arpu commented 5 years ago

wau thx!

arpu commented 5 years ago

from slackuser klaus

klausw 9:56 PM PSA, please be aware that the WebXR specification fairly recently added a requirement that most reference spaces must be requested as a feature at session creation time, and the requestReferenceSpace call will fail if this wasn't done. See https://immersive-web.github.io/webxr/#feature-dependencies for details. Chrome enforces this restriction as of Canary 78.0.3886.0. In short, you can use local reference space in immersive sessions without changes, but others such as local-floor need to be requested as a feature first, for example navigator.xr.requestSession('immersive-vr', {requiredFeatures: ['local-floor']}). If you see pre-existing WebXR applications failing with errors such as "This device does not support the requested reference space type", that's likely due to the application not making the needed feature requests.

felipenmoura commented 4 years ago

I made a quick "solver" snippet for those desperate for a solution! https://github.com/aframevr/aframe/issues/4354#issuecomment-567052948

It's not a real or global solution, but it works for those that had it working and suddenly it crashed (and the fix, which was to update aframe to 1.0 brought a different problem, with the raycaster). This is just a really fast, temporary fix.