This error is due to the following code in TextLine.getBoundingClientRect:

var rect = this.getBoundingClientRect();
if (!result) {
if (view._wrapMode) {
var rects = this.getClientRects();
// rects is empty at this point
result = rects[rects.length - 1];
// result is undefined at this point
result.left = result.right;

Either I am misusing wrapMode = true or this is really a bug?!
Do you have any suggestions for me?