据我所知,所有 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 都在客户端/ Controller 中。
最佳答案
Meteor 的目录结构区分大小写。使用 client
而不是 Client
来解决您的问题。
关于javascript - 引用错误: Template is not defined in Meteor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32960042/