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() {...}

将空格去掉,就正常了

 

原因,待查。。。

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

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

 

无法直视。。。。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-07-16
  • 2021-09-09
  • 2021-06-26
  • 2021-05-18
  • 2021-07-01
猜你喜欢
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
相关资源
相似解决方案