请问楼主解决了吗?
Cannot read property 'indexOf' of undefined?我在当前页面没有使用indexOf,而且在开发者工具上测试没有问题,使用真机测试的时候,我点击生成海报 就报Cannot read property 'indexOf' of undefined
2020-12-12请问楼主解决了吗?
使用canvas线上报错 'indexOf' of undefined?运维中心查到的错误内容如下,相关代码里没有用到 indexOf 报错的位置 https://lib/WASubContext.js:2:408172 这种文件是小程序内置的代码吗?有办法查到具体报错的位置吗? Cannot read property 'indexOf' of undefined; [Component] Event Listener Error @ frameBase/components/canvas-to-image/canvas-to-image#(anonymous) TypeError: Cannot read property 'indexOf' of undefined at g (https://lib/WASubContext.js:2:408172) at Ae (https://lib/WASubContext.js:2:627116) at i.Me.<computed> [as drawImage] (https://lib/WASubContext.js:2:637700) at i.p.<computed> [as drawImage] (https://lib/WASubContext.js:2:1236535) at be.canvasDraw (https://usr//pages/produce/app-service.js:4120:4173) at be.B.d.<computed>.<computed>.d.addListener.capture (https://lib/WASubContext.js:2:1473055) at r.safeCallback (https://lib/WASubContext.js:2:1243366) at r.call (https://lib/WASubContext.js:2:1243259) at o (https://lib/WASubContext.js:2:1246663) at https://lib/WASubContext.js:2:1247404
2020-12-12请问楼主解决了吗
调用画布drawImage时报错- 当前 Bug 的表现(可附上截图) 在调用drawImage()时会产生很多报错日志在小程序后台,但是却排查不出问题,毕竟参数没有错误,编译器也没报错,就是小程序后台的报错日志会有:undefined is not an object (evaluating 't.indexOf') [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo var ctx = wx.createCanvasContext('myCanvas1'); // 绘图开始 ctx.setFillStyle('#e9564f'); ctx.fillRect(0, 0, 320, 524); ctx.save(); // 画用户头像 ctx.beginPath(); ctx.arc(160, 46, 27.5, 0, 2 * Math.PI); ctx.fill(); ctx.clip(); temAvatar = 'http://tmp/wx4692f08fa6ad3bc2.o6zAJs3vnbKuh2g7so7z2zZ83jzw.jVjUUrNRLbuh80237f2eb1b24ecf0a03be51c97c5fdc.jpeg'; ctx.drawImage(temAvatar, 132.5, 18.5, 55, 55); ctx.restore(); ctx.save(); //画发起者昵称 ctx.setFillStyle('#fde7c1'); ctx.setFontSize(13); ctx.setTextAlign('center'); ctx.fillText('name', 160, 92); ctx.save();
2020-12-12