wechat-miniprogram / wxml-to-canvas

MIT License
158 stars 42 forks source link

Unhandled promise rejection TypeError: Cannot read property 'top' of undefined #24

Open cnyejiasheng opened 2 years ago

cnyejiasheng commented 2 years ago

操作过程: 1、在页面中点击“运行片段”:https://developers.weixin.qq.com/s/r6UBlEm17pc6 2、在小程序开发工具IDE中打开代码片段 3、在小程序开发IDE中,直接点击“导出图片”按钮就出现提下错误:

错误信息: Unhandled promise rejection TypeError: Cannot read property 'top' of undefined at index.js? [sm]:165 at new W (WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2) at Mi.canvasToTempFilePath (index.js? [sm]:163) at Mi.extraImage (index.js? [sm]:18) at Object.i.safeCallback (WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2) at WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2 at wr (WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2) at WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2 at h (WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2) at WASubContext.js?t=wechat&s=1648970985557&v=2.23.2:2(env: Windows,mp,1.05.2203070; lib: 2.23.2)

在库文件index.js代码中,出错的位置: canvasToTempFilePath(args = {}) { return new Promise((resolve, reject) => { const { top, left, width, height } = this.boundary wx.canvasToTempFilePath({ x: left, y: top, width,

小程序开发工具版本:1.05.22 调试基础库:2.23.2