ReferenceError:Meteor中未定义模板

时间:2015-10-06 00:47:33

标签: javascript html5 meteor

据我所知,所有的javascript文件和HTML都是正确的。

W20151006-00:40:17.144(0)? (STDERR)
W20151006-00:40:17.145(0)? (STDERR) /home/nitrous/.meteor/packages/meteor-tool/.1.1.9.b2s4xu++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib
/node_modules/fibers/future.js:245
W20151006-00:40:17.147(0)? (STDERR)                                             throw(ex);
W20151006-00:40:17.149(0)? (STDERR)                                                   ^
W20151006-00:40:17.158(0)? (STDERR) ReferenceError: Template is not defined
W20151006-00:40:17.158(0)? (STDERR)     at Client/Controllers/convert.js:1:1
W20151006-00:40:17.159(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/app/Client/Controllers/convert.js:33:4
W20151006-00:40:17.159(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/boot.js:242:10
W20151006-00:40:17.159(0)? (STDERR)     at Array.forEach (native)
W20151006-00:40:17.159(0)? (STDERR)     at Function._.each._.forEach (/home/nitrous/.meteor/packages/meteor-tool/.1.1.9.b2s4xu++os.linux.x86_64+web.browser+web.cordova/mt-os.
linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20151006-00:40:17.159(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/boot.js:137:5
=> Exited with code: 8
W20151006-00:40:21.743(0)? (STDERR)
W20151006-00:40:21.744(0)? (STDERR) /home/nitrous/.meteor/packages/meteor-tool/.1.1.9.b2s4xu++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib
/node_modules/fibers/future.js:245
W20151006-00:40:21.745(0)? (STDERR)                                             throw(ex);
W20151006-00:40:21.747(0)? (STDERR)                                                   ^
W20151006-00:40:21.757(0)? (STDERR) ReferenceError: Template is not defined
W20151006-00:40:21.757(0)? (STDERR)     at Client/Controllers/convert.js:1:1
W20151006-00:40:21.757(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/app/Client/Controllers/convert.js:33:4
W20151006-00:40:21.757(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/boot.js:242:10
W20151006-00:40:21.757(0)? (STDERR)     at Array.forEach (native)
W20151006-00:40:21.757(0)? (STDERR)     at Function._.each._.forEach (/home/nitrous/.meteor/packages/meteor-tool/.1.1.9.b2s4xu++os.linux.x86_64+web.browser+web.cordova/mt-os.
linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20151006-00:40:21.758(0)? (STDERR)     at /home/nitrous/Assignment_1a/.meteor/local/build/programs/server/boot.js:137:5

我正在使用

autopublish           1.0.4 
blaze-html-templates  1.0.1 
ecmascript            0.1.5 
es5-shim              4.1.13  
insecure              1.0.4  
jquery                1.11.4  
meteor-base           1.0.1  
mobile-experience     1.0.1  
mongo                 1.1.2  
session               1.1.1  
standard-minifiers    1.0.1 
tracker               1.0.9  
twbs:bootstrap        3.3.5  

在一个模板上失败,我有三个。

任何有助于找到问题的帮助都会很棒。

修改 我让他们三个都在子文件夹中,所有的js都在Client / Controllers中。

File system

2 个答案:

答案 0 :(得分:1)

Meteor的目录结构区分大小写。使用client代替Client来解决您的问题。

答案 1 :(得分:1)

您的客户端代码显然正在未定义Template的服务器上运行(以及许多其他对象,例如:jQuery)。模板助手只是客户端。