Repository navigation
Errors and Edge Cases
tw check prints the renderer, scene and pixel lines (see Commands), then one heading per kind of problem, then result:. The headings it printed in the runs below are EXCEPTIONS, ERRORS, CHECK and fix hints; three's own deprecation warnings have their own heading and always fail. Any problem makes the result PROBLEMS FOUND and the exit code 1. Other console warnings only print, unless --strict. A 404 for /favicon.ico is ignored.
The repository's tests/fixtures/pages/black-mesh page has a MeshStandardMaterial cube, no light and no environment:
tw check black-mesh/page: http://127.0.0.1:<port>/index.html
three: r186 · scenes 1 · render calls <n>
renderer: WebGLRenderer canvas 960x540 dpr 1 · draw calls 1 · tris 12 · geometries 1 · textures 1 · programs 1 · output srgb · toneMapping None · shadows false
gpu: ANGLE (NVIDIA, NVIDIA GeForce RTX 5060 Ti (0x00002D04) Direct3D11 vs_5_0 ps_5_0, D3D11)
cdn: 2 file(s) served locally (three@0.186.1 from cache)
scene: Scene 1, Mesh 1
meshes 1 · lights 0 · verts 24 · tris 12 · materials 1 · textures 0 · environment false · background null
bounds: center 0,0,0 size 1,1,1
camera: PerspectiveCamera pos 0,0,4 fov 50 near 0.1 far 50 aspect 1.78
pixels: 0% differ from the background #000000 · mean luma 0 · <n> colours
CHECK (2):
lit materials but no lights and no scene.environment: meshes will render black
the canvas is one flat colour (#000000): nothing rendered, or the camera sees nothing
result: PROBLEMS FOUND
tests/fixtures/pages/stale-projection sets camera.aspect and never updates the projection. The check reads the projection matrix, so it catches it (since 0.3.0):
tw check stale-projection/CHECK (1):
camera.aspect is 1.78 but the projection matrix still uses 1: call camera.updateProjectionMatrix() after setting aspect
result: PROBLEMS FOUND
tw check missing-import-map/page: http://127.0.0.1:<port>/index.html
three: not detected · scenes 0 · render calls <n>
gpu: ANGLE (NVIDIA, NVIDIA GeForce RTX 5060 Ti (0x00002D04) Direct3D11 vs_5_0 ps_5_0, D3D11)
EXCEPTIONS (1):
TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
ERRORS (1):
Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
CHECK (1):
no three.js scene observed (three.js not loaded, a second copy of three, or nothing rendered yet)
fix hints (1):
the import map lacks an entry for this specifier; addons import bare "three", so map "three" (and "three/addons/", "three/webgpu", "three/tsl" as used)
result: PROBLEMS FOUND
The fix hints come from scripts/lib/hints.mjs, which matches known error texts (a missing import-map entry, a missing DRACOLoader, a WebGPU texture swizzle error).
| Command | 0 | 1 |
|---|---|---|
check, shaders
|
OK, every program linked | a problem found, a program failed |
lint |
no errors (warnings and notes allowed) | an error; with --strict, any warning |
glb |
report printed, warnings allowed | with --strict, any warning |
diff |
PASS | FAIL |
versions --check |
everything current | a package behind |
An unknown command prints the help and exits 2; a command that throws prints the error and exits 1 (scripts/tw.mjs).
The warnings and their thresholds are listed on Commands. One number there changed meaning in 0.6.6: draw calls are counted per node that draws a mesh, not per mesh (see Versions and upgrading).
-
result: OKdoes not mean the page looks right: bloom-webgpu once passed while blown out (HANDOFF). Look at onetw shot. -
WebGPURenderer'sinfo.render.callscountsrender()calls since the start; the per-frame number isinfo.render.drawCalls. -
tw shaderslists WebGL programs only; WebGPU WGSL errors show up intw check. - Headless Chrome reports
prefers-color-scheme: dark; pass--color-scheme lightfor a light palette. - Headless Chrome ran at a 60 fps vsync cap on the test machine, so
tw perffps is uninformative; read p95, p99 and max. -
--evaltakes one expression; join steps with commas. - Git Bash does not convert
/tmp/...?querypaths; pass aC:/...path when a local page carries a query string outside/c/. tw maps/c/...itself on Windows (0.4.1). - On the html-importmap starter, which animates, the scene bounds and the screenshot's pixel box move between runs, and the render-call count depends on how long the page ran. A
check --againstcomparison can report a real change even when the source is unchanged. The browser test uses a static fixture from 0.6.7; the comparison thresholds are unchanged. - In one of seven verification runs,
tw scene site/printed only the rootSceneline with no children; the other runs printed the full tree. Not reproduced since; if it happens, run it again or usetw check site/ --tree.
Using it
- Getting started
- The skills
- Commands
- The knowledge base
- Templates
- Errors and edge cases
- Recipes
- Works with
- FAQ
The releases
Contributing
Elsewhere