Hello - I am loading two scene.glTF models (downloaded from SketchFab) and both throw an XML parsing error in Firefox but not Chrome or Edge. The models render but I would like to get rid of the errors.
I examined the files in a JSON validator which reported valid.
Hello Deltakosh - Thanks for responding. I can not recreate when I load the models from a public github raw file (https://playground.babylonjs.com/#XXLE1N#1). However, one of my models was purchased and I can not make it public. The app loads regardless of the error(s). At this point I am moving on and consider this issue closed.
Just a random thought (and i know you already consider it solved) - but if it does work on raw.github, maybe make sure your server returns the right content type for gltf files. raw.github always uses
Content-Type: text/plain; charset=utf-8
which is not the gltf format, but it seems to work correctly when set this way so you might want to adjust your server return type to avoid errors in the future.
I have been ignoring this error for awhile, as it does not actually stop things from loading, just makes some console spam for every mesh I load. But, where exactly would I set that content type so it returns correctly?
I am using standard add MeshTask: pwtMeshLoader.assetManager.addMeshTask(meshName, "", meshPath, meshFName);
and figure the best place is inside that function, but that would involve extending babylon and that just does not seem right. What would be the easiest way to set this?