当我将 Mousetrap javascript 文件 (http://craig.is/killing/mice) 放在 Meteor 应用程序的主目录中时,出现以下错误:
Your app is crashing. Here's the latest log.
app/mousetrap.js:711
_addEvent(document, 'keypress', _handleKey);
^
ReferenceError: document is not defined
at app/mousetrap.js:711:15
at app/mousetrap.js:813:4
at /Users/Suchow/Desktop/Collective/.meteor/local/build/server/server.js:107:21
at Array.forEach (native)
at Function._.each._.forEach (/Users/Suchow/Desktop/Collective/.meteor/local/build/server/underscore.js:76:11)
at run (/Users/Suchow/Desktop/Collective/.meteor/local/build/server/server.js:93:7)
Exited with code: 1
Your application is crashing. Waiting for file change.
当 Mousetrap 文件放置在 client/ 子目录中时,该错误消失。为什么?