Problem with loading a 3D module

1. A concise explanation of the problem you're experiencing.
Hi guys, when I loaded my 3D module, it just kept telling me "RuntimeError: Failed to load model: [object Object]" but I can't fix the problem. However, when using the sample data, it worked. By the way, I'm using Cesium-1.41 version.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

var viewer = new Cesium.Viewer('cesiumContainer', {
    infoBox : false,
    selectionIndicator : false,
    shadows : true,
    shouldAnimate : true
});

function createModel(url, height) {
    viewer.entities.removeAll();

    var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
    var heading = Cesium.Math.toRadians(135);
    var pitch = 0;
    var roll = 0;
    var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
    var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);

    var entity = viewer.entities.add({
        name : url,
        position : position,
        orientation : orientation,
        model : {
            uri : url,
            minimumPixelSize : 128,
            maximumScale : 20000
        }
    });
    viewer.trackedEntity = entity;
}

var options = [{
    text : 'Aircraft',
    onselect : function() {
        createModel('../../../../Apps/SampleData/models/CesiumAir/Cesium_Air.glb', 5000.0);
    }
}, {
    text : '101',
    onselect : function() {
        createModel('../../../../Apps/SampleData/models/01/101-2.glb', 0);
    }
}];

Sandcastle.addToolbarMenu(options);

The console shows:

RuntimeError: Failed to load model: [object Object]
Error
    at new RuntimeError (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:10302:19)
    at https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:141603:40
    at Promise.then (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:8896:33)
    at https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:8976:13
    at processQueue (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:9326:4)
    at _resolve (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:9012:4)
    at promiseReject (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:9045:11)
    at Promise.then (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:8896:33)
    at https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:8977:7
    at processQueue (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:9326:4)

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you're using, your operating system and browser.

Hi, would you be to able to send me the model that’s failing so I can help debug? If you don’t want to post it here you can email it to me at slilley@agi.com

Thank you so much!

101-2.glb (112 KB)

Thank you so much!

101-2.glb (112 KB)

I’m not sure what the problem is, but it seems to be loading fine in Cesium 1.43 (image attached).

I reloaded cesium 1.43 and it still showed the same problem.
The document below are screenshots of the the errors.

Please help me solve the problem, thank you so much.

cesium.docx (2.1 MB)

I see that npm error sometimes too and to fix it I either run npm install again or run the npm install as administrator.

Once you have the server running with npm start and run Sandcastle from http://localhost:8080 those other errors should go away.

The problem is the model url is a relative path to a local file and most browsers won’t let you load it unless everything is running in a local server.