[Solved] GLTFLoader DRACOLoader in nodejs

GLTFLoader has a dependency to XMLHttpRequest so it’s not possible to use GLTFLoader.load() without a XHR emulation. Instead, can you try to use fs to load the glb and then pass it directly to the .parse() method. So something like:

const loader = new GLTFLoader();
loader.parse( data, path, onLoad, onError );

There will be problems if your model has textures since HTMLImageElement is not available on node. Same for URL.createObjectURL() which is needed for processing binary image data.

TBH I don’t know if it works at all, so I guess you have to find it out. I would start with a simple glb first and move on with Draco if the everything works.