Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createXRStore fails on WebXR Viewer for iOS #337

Open
valado opened this issue Aug 21, 2024 · 7 comments
Open

createXRStore fails on WebXR Viewer for iOS #337

valado opened this issue Aug 21, 2024 · 7 comments

Comments

@valado
Copy link

valado commented Aug 21, 2024

Description

With the previous version it used to work running WebXR on iOS using one of the XR-ready web browsers available, such as:
WebXR Viewer
XR Browser

Error

The new version of @react-three/xr throws the following error:
`
Shim: We don't expect user adds event before stating session.

addEventListener@user-script:28:33:28
setupSessionGrantedListener
vendors-node_modules_react-three_drei_core_Text_js-node_modules_react-three_fiber_dist_react--33db12.js:18208:35
createXRStore
vendors-node_modules_react-three_drei_core_Text_js-node_modules_react-three_fiber_dist_react--33db12.js:17972:70
`

How to reproduce

  1. install one of the WebXR-ready browsers (links above)
  2. Run the AR example project
@bbohlender
Copy link
Collaborator

you can disable the feature that is causing the error enterGrantedSession: false

I assume these apps are rather outdated and thus are not aware of https://github.com/immersive-web/navigation and I cannot detect if they support this feature.

Since they might also not support other features, it might also be required to disable others, to have them work

@cyango
Copy link

cyango commented Aug 21, 2024

Is there a way to know if the device supports any of the react xr store properties? like mesh detection and stuff

@bbohlender
Copy link
Collaborator

@cyango WebXR operates by allowing developers to request optional features. Therefore you can always request a feature and If its not available, it will not be enabled, which is basically checking for support.

@valado
Copy link
Author

valado commented Aug 23, 2024

Thanks @bbohlender !

you can disable the feature that is causing the error enterGrantedSession: false

This solved the error I was getting.

Nevertheless, now I have an issue with <Interactive onSelect={...}>...</> and <group onClick={...}/>...</> (migrated to group after I saw that Interactive is deprecated).
The onSelect/onClick are not getting called.
This is again only reproducible on iOS using one of the two mentioned browsers supporting WebXR.

Is this a separate issue?
Thanks in advance!

@bbohlender
Copy link
Collaborator

@valado sorry for the delay. I'd love to help you out on this but I dont own a iOS device and I also would not want to put effort into supporting unsupported browsers that are most likely not spec complaint. If you can identify a bug in this library I'll happily fix it asap, but I suspect the inability to click/interact with things is due to the outdated browser implementation not emitting the correct events. This is only a suspicion I unfortunately cannot test right now :)

@valado
Copy link
Author

valado commented Sep 4, 2024

@bbohlender the fact that it works in Chrome on Android kind of points towards the browser. Nevertheless, it is weird that it used to work with the previous major version of the lib.

Do you have any pointers on how can I dig a bit deeper short of adding some console.log calls within the lib (inside node_modules) and figuring out how to get the console stream out of the WebXR Viewer?

@bbohlender
Copy link
Collaborator

this new major version uses more WebXR features that are in the spec but not supported (specifically, computing the difference between any two WebXR spaces). I assume the error is the same as for the old WebXR API Emulator, which will happen for the controller implementation, so it might start to work if you start to disable certain features, such as the controllers createXRStore({ controller:false }).

@bbohlender bbohlender changed the title createXRStore fails on iOS using WebXR Viewer createXRStore fails on WebXR Viewer for iOS Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants