Hello, I am getting the following error when trying to render a simple .glTF image with React-3-fiber.
Code
//@ts-nocheck
import {Canvas, useFrame, useLoader} from “@react-three/fiber”;
import {useRef, Suspense, useEffect, startTransition} from “react”;
import cube from “…/…/…/public/cube.gltf”;
import { GLTFLoader } from ‘three/examples/jsm/loaders/GLTFLoader’;
export default function FiberProto() {
const gltf = useLoader(GLTFLoader, cube);
const [startTransition, isPending] = useTransition({ timeoutMs: 3000 });
return (
Canvas
Suspense fallback={null}
primitive object={gltf.scene}
Suspense
Canvas
);
}
(removed markup from return I assume its being scrubbed)
I get the following error,
I’ve tried to remove the tag entirely, and tried supplying it with different fallback components, but I still get the same crash
Edit: My project was misconfigured, it was showing it was on React 18 but it was actually on React 17 and fixing that resolved the issue