Closed bovealexandre closed 1 month ago
three
@react-three/fiber
@react-three/drei
node
npm
yarn
Hi I'm having a problem with the use of text every time I try to put text I receive this error : Error: R3F: P is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively
'use client'; import * as THREE from 'three'; import { Canvas, useLoader } from '@react-three/fiber'; import { ContactShadows, Environment, Text3D } from '@react-three/drei'; import { Suspense } from 'react'; import { useTranslations } from 'next-intl'; import { cn } from '@/lib/utils'; import localFont from 'next/font/local'; const myFont = localFont({ src: '../fonts/linotype-didot-roman.ttf', display: 'swap' });
<Canvas shadows style={{ height: '100vh', width: '100vw' }} camera={{ position: [0, 5, 13], fov: 25 }} > <Suspense fallback={<SuspenseFallback />}> <ambientLight intensity={2} /> <directionalLight position={[2, 1, 1]} /> <group name="logo"> <Text3D font={'fonts/linotype-didot-roman.ttf'}>QAP</Text3D> <mesh> <boxGeometry args={[1, 1, 1]} /> </mesh> </group> </Suspense> </Canvas>
I don't have any ideas on how to fix it because once I remove the Text3D it works and I'm implementing it the proper way
I fixed it I had to use a typeface and not the font file
three
version: latest@react-three/fiber
version: latest@react-three/drei
version: latestnode
version: 20.16.0npm
(oryarn
) version: 1.22.22Problem description:
Hi I'm having a problem with the use of text every time I try to put text I receive this error : Error: R3F: P is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively
Relevant code:
Suggested solution:
I don't have any ideas on how to fix it because once I remove the Text3D it works and I'm implementing it the proper way