MeteorJS:Meteor.call 中的错误

MeteorJS: Error in Meteor.call

我在客户端有这段代码

Template['product'].events
  'click .addcart': (event, template) ->
    event.preventDefault()
    add_this = {"item": 1, "name": "test", "qty": 5, "price": 124}
    Meteor.call "Carts.push", add_this
   return

并在服务器中

Meteor.methods
  'Carts.push': (params) ->
    console.log params

每次单击添加购物车按钮时,服务器端都会出错

Exception while invoking method 'Carts.push' Error: Did not check() all arguments during call to 'Carts.push'

知道为什么这个错误仍然存​​在吗?

您安装了 audit-argument-checks 包,它用于验证您是否 check 编辑了传递给方法的所有参数。 checking 表示证明函数的参数是正确的类型。您可以使用以下方法删除它:

meteor remove audit-argument-checks

check()你的论点如shown in the docs