# WebXRDefaultExperience Icon error shows Error when clicked

**URL:** <https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011>\
**Category:** Questions\
**Tags:** webxr\
**Created:** [November 4, 2021, 11:07pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011 "2021-11-04T23:07:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Scherotter1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_scherotter1/32/16678_2.png) [@Michael\_Scherotter1](https://forum.babylonjs.com/u/Michael_Scherotter1)\
**Post date:** [November 4, 2021, 11:07pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/1 "2021-11-04T23:07:18Z")

</div>

Using the WebXRDefaultExperience. the VR button shows up in the lower right of my screen because I have the WebXR API Emulator installed in my browser, Edge and Chrome on Windows 11.  
When I click on the Button, the word Error is display over the button and the experience does not go into XR.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/6/666160cb86058c3ede40ff5d8fb0057170c59b48.png)  
what could be causing this and how to debug?  
Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 4, 2021, 11:25pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/2 "2021-11-04T23:25:20Z")

</div>

Summoning @RaananW the WebXR djinn 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_Scherotter1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_scherotter1/32/16678_2.png) [@Michael\_Scherotter1](https://forum.babylonjs.com/u/Michael_Scherotter1)\
**Post date:** [November 4, 2021, 11:45pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/3 "2021-11-04T23:45:14Z")

</div>

there is nothing coming out of the console output that would provide a hint.  
except this: when the scene initializes.  
WebXR emulator extension overrides native WebXR API with polyfill.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [November 5, 2021, 9:10am UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/4 "2021-11-05T09:10:47Z")

</div>

Do you have the emulator open in the console? Can you make sure you have selected a device that fits the current requested session (vr or ar) and that it is running correctly?

Can I also ask - what scene are you trying to run? Any custom features that you are trying to initialize?

Also - hovering over the button should show you the error (it should be in the title of the image).

---

<div class="post-metadata">

**Author:** ![Michael\_Scherotter1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_scherotter1/32/16678_2.png) [@Michael\_Scherotter1](https://forum.babylonjs.com/u/Michael_Scherotter1)\
**Post date:** [November 5, 2021, 4:08pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/5 "2021-11-05T16:08:06Z")

</div>

I am using BABYLON.GUI heavily but turn it off when going into VR -  
I have tried all of the devices in the WebXR emulator.

the error message is: Error entering XR session - immersive-vr - local-floor

---

<div class="post-metadata">

**Author:** ![Michael\_Scherotter1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/michael_scherotter1/32/16678_2.png) [@Michael\_Scherotter1](https://forum.babylonjs.com/u/Michael_Scherotter1)\
**Post date:** [November 5, 2021, 4:21pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/6 "2021-11-05T16:21:39Z")

</div>

I think I figured it out - an uncaught exception in my code entering the VR state.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [November 8, 2021, 12:36pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/7 "2021-11-08T12:36:27Z")

</div>

Was it the exception, then? 😃

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [November 8, 2021, 1:21pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/8 "2021-11-08T13:21:03Z")

</div>

This is the promise failing. I’ll see what we can do in logging the rejection more clearly. It should be at least logging it in the console. Can you share the code that failed so I will see what went wrong?

---

<div class="post-metadata">

**Author:** ![Calsa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/calsa/32/4330_2.png) [@Calsa](https://forum.babylonjs.com/u/Calsa)\
**Post date:** [April 7, 2023, 7:12pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/9 "2023-04-07T19:12:27Z")

</div>

I hate to necromance an old thread, but was this ever figured out or was any more verbose debugging ever included to help? I am getting the same error goggles of death but my console is showing a clean launch.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 7, 2023, 9:43pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/10 "2023-04-07T21:43:47Z")

</div>

Adding @RaananW but bear with him as he is in vacation for a bit 🙂

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 7, 2023, 9:43pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/11 "2023-04-07T21:43:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 17, 2023, 11:46am UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/12 "2023-04-17T11:46:26Z")

</div>

Oh no. This was supposed to be fixed. The error should be logged, unless it is an error that happens before the XR session even starts (which is out of our control). Would you be able to reproduce that?

BTW - On desktop you can hover over the button and see the error (if it is an XR error). I understand it might be an issue on mobile though…

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [May 9, 2023, 12:43pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/13 "2023-05-09T12:43:54Z")

</div>

Sorry, following up on this today -

If you define the onError parameter of the ui options in the default XR experience you will get the error and will be able to log it. This is needed when the error is not a part of the actual initialization of the session (the babylon code). Here is an example:

[WebXR basic example with teleportation | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#9K3MRA#1253)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [May 9, 2023, 12:43pm UTC](https://forum.babylonjs.com/t/webxrdefaultexperience-icon-error-shows-error-when-clicked/25011/14 "2023-05-09T12:43:58Z")

</div>


