THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN problem

/* eslint-disable no-unused-vars */
/* eslint-disable react/no-unknown-property */
import React, { Suspense, useEffect, useRef, useState } from 'react';
import { Canvas, events } from '@react-three/fiber';
import { OrbitControls, Preload, SpotLight, useGLTF, useHelper } from '@react-three/drei';
import { Html } from '@react-three/drei';
import * as THREE from 'three';
import PropTypes from 'prop-types';


import CanvasLoader from '../Loader'

const Computers = ({ isMobile }) => {


  const computer = useGLTF('./desktop_pc/scene.gltf');
  // Use helper to debug the spotlight
  const spotLightRef = useRef();

  // Use helper to debug the spotlight
  useHelper(spotLightRef, THREE.SpotLightHelper, 'teal');

  return (
    <mesh>
      <hemisphereLight intensity={2} groundColor="black" />
      <pointLight intensity={1} />
      <SpotLight
        // ref={spotLightRef}
        position={[-20, 50, 10]}
        angle={0.13}
        penumbra={1}
        intensity={5}
        distance={0}
        castShadow
        shadow-mapSize={1024}
      />
      <primitive
        object={computer.scene}
        scale={isMobile ? 0.5 : 0.6}
        position={isMobile ? [0, -2, -1.5] : [0, -3.5, 1]}
        rotation={[0, -0.2, -0.1]}
      />
    </mesh>
  )
}
Computers.propTypes = {
  isMobile: PropTypes.bool.isRequired,
};

const ComputerCanvas = () => {
  const [isMobile, setIsMobile] = useState(false);
  const [isLoaded, setIsLoaded] = useState(false); // New state to track loading completion

  useEffect(() => {
    // Add a listener for changes to the screen size
    const mediaQuery = window.matchMedia("(max-width: 500px)");

    // Set the initial value of the `isMobile` state variable
    setIsMobile(mediaQuery.matches);

    // Define a callback function to handle changes to the media query
    const handleMediaQueryChange = (event) => {
      setIsMobile(event.matches);
    };

    // Add the callback function as a listener for changes to the media query
    mediaQuery.addEventListener("change", handleMediaQueryChange);

    // Remove the listener when the component is unmounted
    return () => {
      mediaQuery.removeEventListener("change", handleMediaQueryChange);
    };
  }, []);
  const handleLoadComplete = () => {
    setIsLoaded(true); // Call this once all resources are loaded
  };
  // if (isLoaded) {

  //   alert("content "+ isLoaded);
  // }
  return (
    <Canvas
      frameloop={'demand'}
      shadows
      dpr={[1, 2]}
      camera={{ position: [20, 3, 5], fov: 25 }}
      gl={{ preserveDrawingBuffer: true }}
      onCreated={handleLoadComplete} // Assuming the Canvas triggers this once it's ready
    >
      <Suspense fallback={<CanvasLoader />} >
        <OrbitControls enableZoom={false}
          maxPolarAngle={Math.PI / 2}
          minPolarAngle={Math.PI / 2}
        />
        <Computers isMobile={isMobile} />
      </Suspense>
      <Preload all />
    </Canvas>
  )
}

export default ComputerCanvas

problem is when i open my site in mobile is look like this.

and when i open inspect elemnt in mobile its return me this type of error

chunk-VHL4XXR2.js?v=f0d2aa88:18224 THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The “position” attribute is likely to have NaN values.
_BufferGeometry {isBufferGeometry: true, uuid: ‘369e9df6-be7a-4e27-ad07-316731a36bd9’, name: ”, type: ‘BufferGeometry’, index: null, …}
attributes
:
{position: BufferAttribute}
boundingBox
:
null
boundingSphere
:
Sphere {isSphere: true, center: _Vector3, radius: NaN}
drawRange
:
{start: 0, count: Infinity}
groups
:
[]
index
:
null
isBufferGeometry
:
true
morphAttributes
:
{}
morphTargetsRelative
:
false
name
:
“”
type
:
“BufferGeometry”
userData
:
{}
uuid
:
“369e9df6-be7a-4e27-ad07-316731a36bd9”
__r3f
:
{type: ‘bufferGeometry’, previousAttach: _BufferGeometry, memoizedProps: {…}, eventCount: 0, root: ƒ, …}
_listeners
:
{dispose: Array(1)}
id
:
706
[[Prototype]]
:
EventDispatcher
Show 22 more frames

i do chatgpt , gemini, copilot also but no solustion work. please provide a batter solustion.

white screen showing[balls image],[computer image]

New contributor

jack joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật