老是报这个错误,比如调用系统拍照的时候

来源:5-4 第五天 微信菜单-生成菜单

慕村4893497

2017-06-08

 TypeError: Cannot read property 'type' of undefined
      at Object.exports.tpl (D:\SDHTools\wechat\wechat\util.js:56:19)
      at Object.Wechat.reply (D:\SDHTools\wechat\wechat\wechat.js:788:20)
      at Object.module.exports (D:\SDHTools\wechat\wechat\g.js:51:26)
      at next (native)
      at Object.<anonymous> (D:\SDHTools\wechat\node_modules\koa\node_modules\koa-compose\index.js:28:19)
      at next (native)
      at onFulfilled (D:\SDHTools\wechat\node_modules\koa\node_modules\co\index.js:65:19)
      at process._tickCallback (node.js:369:9)


写回答

1回答

Scott

2017-06-11

可以把 util.js 代码贴出来看一下,是不是 content 这里有问题,没有先判断是否为空,另外就是 g.js 里面,是不是没有正确的拿到推送的数据

0
0

7天搞定Node.js微信公众号

Koa框架、ES2015新特性、MongoDB,开发微信公众号

1742 学习 · 787 问题

查看课程