Meteor in August 2014 moved from meteorite packaging towards supporting a built in package management as part of the core framework. As of this writing, Meteor is at v0.9.0.1.
I was in the process of creating a package for meteor and encountered a couple of errors. It was not easy to find answers so I thought i would post them here:
Error 1: Uncaught ReferenceError: Template is not defined
I was in the process of creating a package for meteor and encountered a couple of errors. It was not easy to find answers so I thought i would post them here:
Error 1: Uncaught ReferenceError: Template is not defined
Exception from Deps recompute function: Error: No such template:
Adding the following in package.js solved the error for me:
package.js:
api.use(['templating'],'client');
Adding the following in package.js solved the error for me:
package.js:
api.use(['templating'],'client');
Error 2: Uncaught TypeError: Cannot set property 'rendered' of undefined ez-menu.js:2
Exception from Deps recompute function: Error: No such template:
This error was tricky to find and i did a lot of google-fu to figure out what was going wrong. Since i solved the first error, i knew the Template was defined now. But, why would the rendered function not be available. Why was the template coming back as undefined???
The silliness was the order of operations in package.js..
- Make sure you add the HTML file before any CSS or JS files
- api.addFiles('easy-side-menu.html', 'client');
- api.addFiles(['easy-side-menu.js', 'slideout-menu.css'], 'client');
2 comments:
I ran into the issue with trying to use Templates within a package and this solved the problem. Thanks!
In case Template not defined problem persists, make sure the code using `Template` is available to the client only.
Post a Comment