useEffect(() => {
const loadRobot = async () => {
useLoader(URDFLoader, filepath, (loader) => {
loader.loadMeshCb = (path, manager, done) => {
new STLLoader(manager).load(
path,
(result) => {
console.log(result);
},
null,
(err) => done(null, err)
);
};
loader.fetchOptions = {
headers: { Accept: "application/vnd.github.v3.raw" }
};
});
};
loadRobot().catch(console.error);
}, []);
I have tried SSR & Client side but it not work with both approch.
with SSR it gives DOM / Document error as we know that DOM / Document is not available on server & with Client side it always showes TypeError: Cannot add property loadMeshCb, object is not extensible.
New contributor
ASHWANI SHARMA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.