微信小程序调用出错,去掉setData就没错了

im.getQuery().withLastMessagesRefreshed().containsMembers([userId]).find().then(function (conversations) {
        // console.log(conversations);
        that.setData({
          conversations: conversations
        });
        // 默认按每个对话的最后更新日期(收到最后一条消息的时间)倒序排列
        // conversations.map(function (conversation) {
        //   console.log(conversation.lastMessage.summary, conversation.unreadMessagesCount, conversation.lastMessageAt.format("yyyy-MM-dd hh:mm:ss"));
        // });
      }).catch(console.error.bind(console));

请问 SDK 版本是多少?

暂时可以使用 setData({ conversation: conversations.toJSON() })

没有toJSON()方法
Uncaught (in promise) TypeError: conversations.toJSON is not a function

我说错了。conversations 是一个数组,conversation 才有 toJSON。

我去年升级微信开发者工具后也遇到这样的问题,回退到2019.04的版本就不出这个问题。但现在这个版本的开发者工具已经太旧了微信已经不支持用它上传了。现在用最新的开发者工具仍然有这个问题,不知为何。