- miniprogram-automator 截图失败
确定开发环境没有问题,因为本来可以截图,后来突然开始报错,重启开发者工具甚至重启电脑都没用。使用 node repl 就可以复现,但只在我的电脑上有问题,由于问题与代码无关,无法提供复现步骤。 报错内容:Error: fail to capture screenshot 操作步骤与详细报错如下。 > const automator = require('miniprogram-automator') undefined > automator.launch({ ... projectPath: ... '/Users/username/dev/wxa-dcp/dist' ... }).then(mpp => global.mpp = mpp) Promise { <pending> } # 不带 options 报错 > mpp.screenshot() Promise { <pending> } > (node:4886) UnhandledPromiseRejectionWarning: Error: fail to capture screenshot at Transport.Connection.onMessage (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/out/Connection.js:1:986) at Transport.emit (events.js:315:20) at Transport.EventEmitter.emit (domain.js:505:15) at WebSocket.<anonymous> (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/out/Transport.js:1:219) at WebSocket.onMessage (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/node_modules/ws/lib/event-target.js:120:16) at WebSocket.emit (events.js:315:20) at WebSocket.EventEmitter.emit (domain.js:505:15) at Receiver.receiverOnMessage (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/node_modules/ws/lib/websocket.js:789:20) at Receiver.emit (events.js:315:20) at Receiver.EventEmitter.emit (domain.js:505:15) (node:4886) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:4886) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. # 带 options 也报错,指定目录无权限问题 > mpp.screenshot({path: '/Users/username/Desktop/aaa.png'}) Promise { <pending> } > (node:4886) UnhandledPromiseRejectionWarning: Error: fail to capture screenshot at Transport.Connection.onMessage (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/out/Connection.js:1:986) at Transport.emit (events.js:315:20) at Transport.EventEmitter.emit (domain.js:505:15) at WebSocket.<anonymous> (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/out/Transport.js:1:219) at WebSocket.onMessage (/Users/username/dev/temp/test-project/node_modules/miniprogram-automator/node_modules/ws/lib/event-target.js:120:16) at WebSocket.emit (events.js:315:20) at WebSocket.EventEmitter.emit (domain.js:505:15) at Receiver.receiverOnMessage (/Users/zhangchaofan/dev/temp/test-project/node_modules/miniprogram-automator/node_modules/ws/lib/websocket.js:789:20) at Receiver.emit (events.js:315:20) at Receiver.EventEmitter.emit (domain.js:505:15) (node:4886) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
2020-06-11 - onAppShareMessage 中指定的 imageUrl 不开调试模式不会生效么?
如题,真机打开体验版小程序,如果不开调试模式的话,转发出去的分享卡片没有使用指定的 imageUrl 而是截图,开了调试就一切正常。图片用的 cdn 域名已经配置了。 还有个有点相关的问题,不开调试模式,小程序不会使用手机本地时间。这个之前不会,是最近新的变动么,在哪里能看到变更日志呢。
2020-02-05