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

ERROR: url.lastIndexOf is not a function #1942

Open
branaust opened this issue Apr 29, 2024 · 0 comments
Open

ERROR: url.lastIndexOf is not a function #1942

branaust opened this issue Apr 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@branaust
Copy link

  • three version: ^0.164.1
  • @react-three/fiber version: ^8.16.2
  • @react-three/drei version: 9.0.1
  • node version: 19.4.0
  • bun version: 1.0.22

Problem description:

Recieving url.lastIndexOf is not a function on initialization

Relevant code:

/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
*/

import * as THREE from "three";
import React from "react";
import { useGLTF } from "@react-three/drei/native";
import { GLTF } from "three-stdlib";
import modelPath from "../assets/model.glb";

type GLTFResult = GLTF & {
  nodes: {
    Torus002: THREE.Mesh;
  };
  materials: {
    Material: THREE.MeshStandardMaterial;
  };
};

const Model = (props: JSX.IntrinsicElements["group"]) => {
  const { nodes, materials } = useGLTF(modelPath) as GLTFResult;

  return (
    <group {...props} dispose={null} scale={2}>
      <mesh
        castShadow
        receiveShadow
        geometry={nodes.Torus002.geometry}
        material={materials.Material}
      />
    </group>
  );
};

useGLTF.preload(modelPath);

export default Model;
import Model from "@/components/Model";
import { View } from "@/components/Themed";
import { Canvas } from "@react-three/fiber/native";
import { Suspense } from "react";

const Home = () => {
  return (
    <View style={{ flex: 1 }}>
      <Canvas>
        <Suspense fallback={null}>
          <Model />
        </Suspense>
      </Canvas>
    </View>
  );
};

export default Home;
@branaust branaust added the bug Something isn't working label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant