This error will be reported if the reject error in the promise is not caught
getImage: function (url) { return new Promise((resolve, reject) => { wx.getImageInfo({ src: url, success: function (res) { resolve(res) }, fail: function () { reject("") } }) }).catch((e) => { console.log(e) }); },
getImage: function (url) { return new Promise((resolve, reject) => { wx.getImageInfo({ src: url, success: function (res) { resolve(res) }, fail: function () { reject("") } }) }).catch((e) => { console.log(e) }); },
As long as you add .catch((e) => {}) at the end, no error will be reported.
Similar Posts:
- error – canvas- Failed to execute ‘toBlob’ on ‘HTMLCanvasElement’: Tainted canvases may not be exported.
- Uncaught SyntaxError: Unexpected token o
- Element-ui Error: Uncaught (in promise) cancel [How to Solve]
- [eslint] Unexpected block statement surrounding arrow body; move the returned value immediately a…
- How to Copy Echarts Map Examples to Local vueCLI Project (Commissioning Operation)
- [Solved] Uniapp Axios appears in wechat applet index.js? [SM]: 33 errortyerror: l is not a function error
- Uniapp cloud storage {“errmsg”: “cloudpath is illegal”}
- [Solved] Vue Axios error: TypeError: Cannot set property ‘tableData‘ of undefined
- Uncaught Error: _registerComponent(…): Target container is not a DOM element
- [Solved] Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to