the error specifically points to the file Text3D.js within the @react-three/drei package.
The error message states:
./node_modules/@react-three/drei/core/Text3D.js
Module parse failed: Unexpected token (63:7)
const { 0: label, 1: …rest} = useMemo(() => getTextFromChildren(children), [children]);
const args = React.useMemo(() => [label, opts], [label, opts]);
How would you troubleshoot and resolve this parsing error to successfully render the 3D model in your Next.js project?
Thanks
I attempted to render a 3D model in my Next.js TypeScript project using @react-three/drei. However, during the build process, I encountered a parsing error related to the Text3D.js file within the @react-three/drei package. The error message pointed to an unexpected token near the spread operator (…rest) on line 63 of Text3D.js.
I expected the 3D model to render successfully without any parsing errors, allowing me to integrate it seamlessly into my Next.js project.