-
-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Description
Steps to reproduce
pnpm create vite
- Select react + typescript + swc
- Copy the code from the introduction page verbatim
- Add
@vitejs/plugin-basic-ssl
as suggested on the development setup page - Run the dev server with
pnpm vite --host
- Open
https://localhost:5173/
on browser - Click
Enter AR
- Lose
Note: works fine on mobile
Errors Encountered
First I'm hit
with and then I get
Code
import { Canvas } from "@react-three/fiber";
import { XR, createXRStore } from "@react-three/xr";
import { useState } from "react";
const store = createXRStore();
function App() {
const [red, setRed] = useState(false);
return (
<>
<button onClick={() => store.enterAR()}>Enter AR</button>
<Canvas>
<XR store={store}>
<mesh
pointerEventsType={{ deny: "grab" }}
onClick={() => setRed(!red)}
position={[0, 1, -1]}
>
<boxGeometry />
<meshBasicMaterial color={red ? "red" : "blue"} />
</mesh>
</XR>
</Canvas>
</>
);
}
export default App;
"dependencies": {
"@react-three/fiber": "^9.1.2",
"@react-three/xr": "^6.6.17",
"@vitejs/plugin-basic-ssl": "^2.0.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"three": "^0.177.0"
},
System info
I'm running on a desktop browser
Brave 1.79.119 (64-bit)
Chromium: 137.0.7151.68
Now sure if it matters but I do have all the relevant webXR flags enables as you can see here
Related Issue
Metadata
Metadata
Assignees
Labels
No labels