# WebXR not working

**URL:** <https://discourse.threejs.org/t/webxr-not-working/11930>\
**Category:** Questions\
**Tags:** webxr\
**Created:** [January 8, 2020, 1:15pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930 "2020-01-08T13:15:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [January 8, 2020, 1:15pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/1 "2020-01-08T13:15:32Z")

</div>

Hey, Im using a Oculus Quest and wanna try out VR. I downloaded the latest version of Threejs r112 and took the [webxr\_vr\_dragging.html](https://threejs.org/examples/?q=webxr#webxr_vr_dragging) example (for playing around) and uploaded it to my own server.

If I visit the example on [threejs.org](http://threejs.org), it is working, but not when I visit it on my domain (with oculus).  
Also when visiting [threejs.org](http://threejs.org) example via PC the VRButton says: “VR NOT SUPPORTED”, but on my own domain saying: “WEBXR NEEDS HTTPS”?

What am I missing? I basicly took the example and changed the necessary paths to threejs. Nothing more.

I just Debugged my oculus quest, the error is:

> Cannot set property ‘enabled’ of undefined

pointing at `renderer.xr.enabled = true;`

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [January 8, 2020, 1:59pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/2 "2020-01-08T13:59:27Z")

</div>

> [@Fluqz](#):
>
> “WEBXR NEEDS HTTPS”?

Are you serving your content via HTTPS? If not, well, then we have found the root cause.

---

<div class="post-metadata">

**Author:** ![mgarchik](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mgarchik](https://discourse.threejs.org/u/mgarchik)\
**Post date:** [March 2, 2021, 1:00am UTC](https://discourse.threejs.org/t/webxr-not-working/11930/3 "2021-03-02T01:00:40Z")

</div>

I am having the same issue. It seems there is something wrong with the WebXRManager because everything calling .xr is saying

> Cannot set property ‘enabled’ of undefined

---

<div class="post-metadata">

**Author:** ![CodyJasonBennett](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/codyjasonbennett/32/17442_2.png) [@CodyJasonBennett](https://discourse.threejs.org/u/CodyJasonBennett)\
**Post date:** [March 2, 2021, 8:45am UTC](https://discourse.threejs.org/t/webxr-not-working/11930/4 "2021-03-02T08:45:21Z")

</div>

[`WebXRManager`](https://threejs.org/docs/index.html#api/en/renderers/webxr/WebXRManager) is accessible under [`WebGLRenderer.xr`](https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer.xr).

```javascript
const renderer = new THREE.WebGLRenderer()
renderer.xr.enabled = true

```

Also, ensure you are working in a secure context when working with WebXR sessions. See: [starting and shutting down a WebXR session by Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Startup_and_shutdown).

If you want a quick dev environment to work in, I’d recommend [Codesandbox](https://codesandbox.io).

---

<div class="post-metadata">

**Author:** ![mgarchik](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mgarchik](https://discourse.threejs.org/u/mgarchik)\
**Post date:** [March 2, 2021, 2:36pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/5 "2021-03-02T14:36:51Z")

</div>

The issue is that

> const renderer = new THREE.WebGLRenderer()  
> renderer.xr.enabled = true  
> gives the error  
> Uncaught TypeError: Cannot set property ‘enabled’ of undefined  
> could the issue be that I am using chrome?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 2, 2021, 2:48pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/6 "2021-03-02T14:48:32Z")

</div>

What version of `three.js` are you using?

---

<div class="post-metadata">

**Author:** ![mgarchik](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mgarchik](https://discourse.threejs.org/u/mgarchik)\
**Post date:** [March 2, 2021, 3:10pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/7 "2021-03-02T15:10:35Z")

</div>

the three.js file I reference was downloaded just the other day

---

<div class="post-metadata">

**Author:** ![mgarchik](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mgarchik](https://discourse.threejs.org/u/mgarchik)\
**Post date:** [March 2, 2021, 3:16pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/8 "2021-03-02T15:16:27Z")

</div>

Now when I try to run the exact same file as the **webxr\_vr\_dragging.html** example, I get the exact same error

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [March 3, 2021, 2:16pm UTC](https://discourse.threejs.org/t/webxr-not-working/11930/9 "2021-03-03T14:16:55Z")

</div>

Can you try to make a demo in jsFiddle or Codepen?
