Richard Lawton
Richard Lawton

Reputation: 53

ReferenceError: Template is not defined in Meteor

As far as I can see all the javascript files and html are correct.

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

I am using

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  

It is failing on one template, I have three.

Any help to find what the issue might be would be great.

EDIT: I have them all three are in a sub-folder, all of the js is in Client/ Controllers.

File system

Upvotes: 0

Views: 1076

Answers (2)

Michel Floyd
Michel Floyd

Reputation: 20256

Your client code is apparently running on the server where Template is not defined (along with many other objects, ex: jQuery). Template helpers are client-side only.

Upvotes: 1

Tarang
Tarang

Reputation: 75975

Meteor's directory structure is case sensitive. Use client instead of Client to solve your issue.

Upvotes: 1

Related Questions