It looks like there's a bug in Primitive being triggered by createTangentSpaceDebugPrimitive. You can work around it by manually setting the returned primitive._asynchronous to false. I'm also not sure why it's not showing up in the doc, I'll file a bug for both issues.
Meanwhile, here's a complete example with the workaround. You might also have to jack up the length value depending on your geometry.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var scene = viewer.scene;
var dimensions = new Cesium.Cartesian3(400000.0, 300000.0, 500000.0);
var positionOnEllipsoid = Cesium.Cartesian3.fromDegrees(-105.0, 45.0);
var boxModelMatrix = Cesium.Matrix4.multiplyByTranslation(
Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid),
new Cesium.Cartesian3(0.0, 0.0, dimensions.z * 0.5), new Cesium.Matrix4());
var boxGeometry = Cesium.BoxGeometry.fromDimensions({
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
dimensions : dimensions
});
var boxGeometryInstance = new Cesium.GeometryInstance({
geometry : boxGeometry,
modelMatrix : boxModelMatrix,
attributes : {
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
}
});
scene.primitives.add(new Cesium.Primitive({
geometryInstances : boxGeometryInstance,
appearance : new Cesium.PerInstanceColorAppearance({
closed: true
})
}));
var debugPrimitive = Cesium.createTangentSpaceDebugPrimitive({
geometry: boxGeometry,
modelMatrix: boxModelMatrix,
length: 100000
});
debugPrimitive._asynchronous = false;
scene.primitives.add(debugPrimitive);