Caught exception: TypeError: Cannot call method 'insert' of undefined

mac 10.9.1, pomelo 0.8.9

使用 pomelo.app.get('dbclient').insert(sql, args, function(err, res) {...});

出现 Caught exception: TypeError: Cannot call method 'insert' of undefined

可以确定的是,在前面的代码中已经使用过该方法

如果换成 

var dbclient = pomelo.app.get('dbclient');

dbclient.insert(sql, args, function(err,res) {...}); 

就能通过

后来发现,是在函数前面多了一个空格

空格characterDao.createCharacter = function() {...}

将空格去掉,就正常了

 

原因,待查。。。

后来发现有几个地方应该打“;”的,写的是“,”

将他们修改为“;”后,再把上面函数前加上空格,好像又能正常运行

 

无法直视。。。。

posted on 2014-04-04 18:04  影语者  阅读(696)  评论(0编辑  收藏  举报

导航