11

我正在使用 Meteor 开发宾果游戏。我现在收到一个错误,因为它在 JS 文件中(我正在写咖啡),我不知道它来自哪里。

这是完整的错误:

ReferenceError: Console is not defined
    at app/Bingo.coffee.js:465:12
    at run (/Users/ppedrazzi/Dropbox/Paul's Stuff/MyApps/Meteor/bingo/.meteor/local/build/server/server.js:283:63)
    at Array.forEach (native)
    at Function._.each._.forEach (/usr/local/meteor/lib/node_modules/underscore/underscore.js:79:11)
    at run (/Users/ppedrazzi/Dropbox/Paul's Stuff/MyApps/Meteor/bingo/.meteor/local/build/server/server.js:283:7)

我已将咖啡和 html 文件放在一个要点中: https ://gist.github.com/ppedrazzi/5303493

感谢您的任何见解!

4

2 回答 2

33

它看起来像你的第 334 行bingo.coffee

在 javascript 中,所有内容都区分大小写,因此使用小写c

console.log "Server started and collections cleared."

代替

Console.log "Server started and collections cleared."

可能会修复语法错误

于 2013-04-03T17:59:34.190 回答
5

而不是这样写:

Console.log "Server started and collections cleared."

像这样写:

console.log "Server started and collections cleared."

总是用小写的 'c' 写 'console' 因为 JavaScript 是区分大小写的语言。

于 2018-11-02T14:48:57.540 回答