Sample Height type error: computeMaximumLevelAtPosition type error

So it appears my terrain is loading correctly:
const local = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(“http://localhost/terrain”));
viewer contains the terrain: local

My function to lookup is:
function foo() {
const positions = [
Cesium.Cartographic.fromDegrees(-85.33, 32.33),
];
Cesium.sampleTerrainMostDetailed(local, positions).then((updatedPositions) => {
// positions[0].height
console.log(positions[0]);
// updatedPositions is just a reference to positions.
})

}

setTimeout(foo,2000)

returns: TypeError: Cannot read properties of undefined (reading ‘computeMaximumLevelAtPosition’)