Hi. I'm have this error when i load .gltf file from Blender :
Module parse failed: Unexpected token (2:12) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| {
> "asset" : {
| "generator" : "Khronos glTF Blender I/O v1.7.33",
| "version" : "2.0"
I add gatsby-node.js:
exports.onCreateWebpackConfig = ({
stage,
rules,
loaders,
plugins,
actions,
}) => {
actions.setWebpackConfig({
module: {
rules: [
{
test: /\.gltf$/,
use: [
`url-loader`,
],
},
],
},
})
}
But its still not work.
My component:
import {useGLTF} from "@react-three/drei";
import logo from '/src/components/react.gltf'
const Model = () => {
const group = useRef()
const { nodes, materials } = useGLTF(logo)
return (
<group ref={group} {...props} dispose={null}>
<mesh geometry={nodes.Text.geometry} material={materials['Material.001']} rotation={[Math.PI / 2, 0, 0]} />
<mesh
geometry={nodes.Text001.geometry}
material={materials['Material.002']}
position={[0, 0, 0.04]}
rotation={[Math.PI / 2, 0, 0]}
/>
</group>
)
}
export default Model