字节小程序 [TMA] RangeError: Invalid array length

tt.createSelectorQuery() 这个在字节开发里不能放在onLoad里,放在onReady里就报错Invalid array length,找了好久找不出问题
HeightW: function () {
var that = this; // 获取左边高度

var query = tt.createSelectorQuery();
query.select('#sbtop').boundingClientRect(function (rect) {
  that.setData({
    tab: rect.height
  });
}).exec();
query.select('#arrow').boundingClientRect(function (rect) {
  that.setData({
    arrow: rect.height
  });
}).exec(); //不滑动页面的高度

let allWidth, allHeight;
tt.getSystemInfo({
  success: function (res, rect) {
    that.setData({
      allWidth: res.windowWidth,
      allHeight: res.windowHeight
    });
  }
});

},

结果显示: RangeError: Invalid array length

img

报无效的数组长度 。说明 你调用了lengeh方法 。但你这个 数组 不存在 或者 不是数组