8thwall / web

8th Wall Web projects and resources.
515 stars 326 forks source link

AFrame React App got errors #214

Closed ArtemOstapov closed 1 year ago

ArtemOstapov commented 1 year ago

Im using Aframe React App example from (https://github.com/8thwall/web/tree/master/examples/aframe/reactapp)

System: Windows 10

After building and starting i'm waiting to see AScene with plane and box on localhost on PC but see the next text:

 Scan or visit
 localhost:3000
 to continue

and 2 errors in console:

XR threw an exception Error: No valid session manager to handle this session.
    at A (xr-simd-21.4.6.997.js:1:10394011)

and

Error: No valid session manager to handle this session.
    at A (cdn.8thwall.com/xr-simd-21.4.6.997.js:1:10394011)

Tell me plz, how to solve that? or maybe I miss something?

amitbeck commented 1 year ago

I too got this. Seems to have started occurring since the latest engine version. I only get it on computers, but not when running on mobile.

jparismorgan commented 1 year ago

Hi @ArtemOstapov and @amitbeck, thanks for the report! I took a look at engine version 21.3.8.997 but am not seeing any difference between it and 21.4.6.997 - to me this looks like it's about the app code. Right now the examples/aframe/reactapp/src/views/cube.html file has xrweb with no attributes:

https://github.com/8thwall/web/blob/ea010eeac5854b8271ad7378fd328da24c49b32f/examples/aframe/reactapp/src/views/cube.html#L8

But to support desktop mode you'll need to add disableWorldTracking and allowedDevices, like so:

xrweb="disableWorldTracking: true; allowedDevices: any;">

You can see these attribute descriptions under xrconfig and xrweb here: https://www.8thwall.com/docs/web/#xr8aframe

Does that solve your issue? Please let me know if not, thank you!

Update: You actually only need disableWorldTracking if you have default image targets. If not you only need allowedDevices: any;.

atomarch commented 1 year ago

All you should need is the allowedDevices param set to any (assuming this is just your basic slam / cube scene and you aren't using Image Targets)

xrweb="allowedDevices: any;">

like this: https://www.8thwall.com/8thwall/manipulate-aframe/code/body.html#L10

Disabling world tracking will disable slam/gyro, and I'm not sure you want that if the experience is also later intended to run on mobile devices.

ArtemOstapov commented 1 year ago

All you should need is the allowedDevices param set to any (assuming this is just your basic slam / cube scene and you aren't using Image Targets)

that solve the issue, big tnx!