hbuilder内置浏览器,uni.canvasToTempFilePath()报错如下:
index.umd.min.js:1
[system] TypeError: Cannot read property 'data' of undefined
at VueComponent.getDataUrl (index.umd.min.js:1)
at VueComponent.handleSubscribe (index.umd.min.js:1)
at invokeWithErrorHandling (vue.runtime.esm.js:1865)
at Vue.$emit (vue.runtime.esm.js:3899)
at Object. [as subscribeHandler] (index.umd.min.js:1)
at Module.a (index.umd.min.js:1)
at v (index.umd.min.js:1)
at M (index.umd.min.js:1)
at index.umd.min.js:1
at x (index.umd.min.js:1)
- 发布:2020-01-06 16:20
- 更新:2020-08-24 13:29
- 阅读:2270
我也遇到了这个问题,我测试了一下发现,在服务器返回跨域信息的时候会出现这个问题。类似于下面这个报错出现的时候
Access to XMLHttpRequest at 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHc7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyVkl1UDhjcm1lemgxTHlBWXh1Y2gAAgTiV5VeAwQAjScA' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
就会遇到
index.umd.min.js?1c31:1 [system] TypeError: Cannot read property 'data' of undefined
at VueComponent.getDataUrl (index.umd.min.js?1c31:1)
at VueComponent._handleSubscribe (index.umd.min.js?1c31:1)
at invokeWithErrorHandling (vue.runtime.esm.js?e143:1865)
at Vue.$emit (vue.runtime.esm.js?e143:3939)
at Object.w [as subscribeHandler] (index.umd.min.js?1c31:1)
at Module.o (index.umd.min.js?1c31:1)
at v (index.umd.min.js?1c31:1)
at A (index.umd.min.js?1c31:1)
at eval (index.umd.min.js?1c31:1)
at x (index.umd.min.js?1c31:1)
panyh (作者)
2.5.1.20200103和## 2.4.6.20191210都不行
2020-01-07 14:35
DCloud_UNI_GSQ
回复 panyh: chrome运行是否正常?
2020-01-07 20:38
panyh (作者)
回复 DCloud_UNI_GSQ: 可以的,看来是内置浏览器问题
2020-01-08 15:39