我参考了CFETeam开源的demo(参见:https://github.com/CFETeam/weapp-session-client),但遇到了奇怪的问题,哪位大侠知道怎样解决?多谢。 github上我提了个issue:https://github.com/CFETeam/weapp-session-client/issues/3
运行环境:微信web开发者工具 v0.11.112200 操作:点击“进入画廊”后报错。
WAService.js:3 TypeError: Promise is not a constructor at co (co.js:50) at createPromise (co.js:30) at requestWithSession (session-request.js:102) at e.loadPaints (list.js:26) at e.onShow (list.js:20) at e.r (WAService.js:3) at g (WAService.js:2) at w (WAService.js:2) at . (WAService.js:3) at WAService.js:3
没有看它的详细源码,参考下这里:http://stackoverflow.com/questions/30033079/promise-is-not-a-constructor 是不是没有对它进行初始化呢?
@mawenge ES6 下是支持的,微信会对 ES6 做转换的,是不是转换的问题。 具体方案参见这里:https://cnodejs.org/topic/57eb4e4bea2fa420446d4371