1. A concise explanation of the problem you’re experiencing.
- RuntimeError {name: “RuntimeError”, message: “Failed to load model: ./CesiumMilkTruck.gltf↵Unexpected token < in JSON at position 0”, stack: “Error↵ at new RuntimeError (webpack-internal://…e_modules/cesium/Source/ThirdParty/when.js:646:4)”}
- message: “Failed to load model: ./CesiumMilkTruck.gltf↵Unexpected token < in JSON at position 0”
- name: “RuntimeError”
- stack: “Error
at new RuntimeError (webpack-internal:///./node_modules/cesium/Source/Core/RuntimeError.js:40:19)
at eval (webpack-internal:///./node_modules/cesium/Source/Scene/ModelUtility.js:174:40)
at Promise.eval [as then] (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:216:33)
at eval (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:296:13)
at processQueue (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:646:4)
at _resolve (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:332:4)
at promiseReject (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:365:11)
at Promise.eval [as then] (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:216:33)
at eval (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:297:7)
at processQueue (webpack-internal:///./node_modules/cesium/Source/ThirdParty/when.js:646:4)”
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
window.viewer.entities.add({
position: Cartesian3.fromDegrees(120.02444386482239, 30.244674682617188, 1000),
model: { uri: ‘./CesiumMilkTruck.gltf’ }
})
window.viewer.zoomTo(window.viewer.entities)
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I just learned Cesium for somedays, and I want to load a 3d model to my Vue project, I copied the model to my file, and like this to add to my project, but I don’t know why I failed.
ps: my English was not so well and if I spell wrong, please not upset, and thank u for help.
4. The Cesium version you’re using, your operating system and browser.
1.64.0 win10 chrome