TypeError: Cannot read property 'TEXT_NODE' of undefined
at vo (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at A.cloneNode (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at new A (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2
at i (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at Object.next (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2
at new Promise ()
at s (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at Ja (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)(env: Windows,mp,1.06.2210310; lib: 2.30.1)
相关平台
微信小程序
小程序基础库: 2.30.0 使用框架: React
复现步骤
html2canvas(document.querySelector("#shareCanvasDialog"), { allowTaint: false, useCORS: true, scrollY: 0, scale: 2 }).then(async canvasRes => { console.log("canvasRes ", canvasRes); }) }}
期望结果
正常保存图片
实际结果
微信开发工具报错如下:
TypeError: Cannot read property 'TEXT_NODE' of undefined at vo (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2) at A.cloneNode (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2) at new A (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2) at index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2 at i (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2) at Object.next (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2) at index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2 at new Promise ()
at s (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)
at Ja (index.js?t=wechat&s=1676596508698&v=a16929ea6ef629e3775d2c2a5183a436:2)(env: Windows,mp,1.06.2210310; lib: 2.30.1)
环境信息