Three ways a load fails
Console only. The address of the site is removed from the message, so the output is the same here and on your computer.
GLTFLoader.loadAsync(url) fetches and parses a model and gives you its scene. Then you measure it, scale it to real size, stand it on the floor, and handle the ways a load fails: a missing file, a file that is not a model, no network.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 4 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write fitToLength(object, metres) that scales an object so its longest side has that length and puts its lowest point at y = 0.
Load the Fox and print the names of its animation clips and its node count.
Explain it without notes
A model loads but nothing appears. Name three things you would check, in order.
What does SyntaxError: Unexpected token '<' usually mean when loading a .glb, and how do you confirm it?
Console
Nothing logged yet.Expected console output
a file that is not there:
Error: fetch for "/data/3d/models/lumen-bikee.glb" responded with 404: Not Found
a file that is not a model:
SyntaxError: Unexpected token '#', "# Assets o"... is not valid JSON
a server that is not reachable:
TypeError: Failed to fetch