WebXR on Oculus Quest: Works in Playground but not in HTML

The WebXR sample sphere playground works great on Oculus Quest in immersive mode: [Babylon.js Playground]
If I take that playground, save it to a zip, then host the index.html, I run into a couple errors. First, the call to createScene() needs to handled in a Promise then call engine.runRenderLoop.
This will render in the Oculus Browser, but the button will not appear to enter immersive mode. Two errors are outputted to the console: “Error initializing XR” and “WebXR available”. WebXR has been enabled and there are no errors when run in the Playground.
Is there a change in how this is handled independently of the Playground?
Thank you

Hi! Thanks for the feedback :grinning:
First the playground - you are right, the playground doesn’t export the async call. We’ll need to see how we do that.

About the experience not working- WebXR works only when using HTTPS. Make sure your local host serves secure content ( maybe not “secure”, but self-signed HTTPS)

1 Like

Thank you RaananW. That was the exact problem.