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 TypeError: Cannot read property 'S' of undefined [Component Stack] #2386

Open
kafeinberkcolakk opened this issue Mar 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@kafeinberkcolakk
Copy link

kafeinberkcolakk commented Mar 13, 2025

"dependencies": {
"expo": "~52.0.37",
"expo-status-bar": "~2.0.1",
"react": "18.3.1",
"react-native": "0.76.7",
"@react-three/drei": "^10.0.4",
"@react-three/fiber": "^9.0.4",
"expo-asset-utils": "^3.0.0",
"expo-gl": "~15.0.4",
"expo-three": "^8.0.0",
"three": "0.132.2",
"three-stdlib": "^2.35.14"
},

Problem description:

(NOBRIDGE) ERROR TypeError: Cannot read property 'S' of undefined [Component Stack]
(NOBRIDGE) ERROR Warning: TypeError: Cannot read property 'useGLTF' of undefined

This error is located at:
in MyScene (created by App)
in RCTView (created by View)
in View (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent)

Relevant code:

import React from "react";
import { GLView } from "expo-gl";
import * as THREE from "three";
import { Asset } from "expo-asset";
import { loadAsync } from "expo-three";
import { useGLTF } from "@react-three/drei/native";

const MyScene = () => {
const test = useGLTF("./assets/classroom.glb");
console.log(test)
};

export default MyScene;

classroom: https://github.com/kafeinberkcolakk/t/blob/main/school_classroom.glb

@kafeinberkcolakk kafeinberkcolakk added the bug Something isn't working label Mar 13, 2025
@muehlt
Copy link

muehlt commented Mar 18, 2025

This is a dependency issue, you can downgrade affected packages for now, to match the required versions.

@NoOne-Cares
Copy link

NoOne-Cares commented Mar 23, 2025

@kafeinberkcolakk
you can try importing useGTF as
import { useGLTF } from "@react-three/drei"
instead of
import { useGLTF } from "@react-three/drei/native"

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

3 participants