I was working on a project using version 0.9.3.1 of Meteor. I've just upgraded to version 1.2.0.1 in order to resume my project.
I've installed the latest version of meteor-roles by running meteor add alanning:roles so that should be up to date. I've had a look at the docs but that hasn't really helped.
Anyone got any ideas on what this error is and how to resolve it?
Exception in template helper: ReferenceError: Match is not defined
at Object.Roles._uiHelpers.isInRole (http://localhost:3000/packages/alanning_roles.js?0f20b892d4a0a11a6ea8431da3d0a0953ba951a9:809:10)
at bindDataContext (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:2986:16)
at Blaze._wrapCatchingExceptions (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:1650:16)
at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3038:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3671:12)
at wrapHelper (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3037:27)
at Spacebars.call (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:167:18)
at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:104:25)
at Object.Spacebars.dataMustache (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:136:39)
at http://localhost:3000/app/client/layout/adminlayout.compiled.html.js?c582d42dde65584f4e6c48e70d8d65fa2cba7589:6:22
I believe that this open issue on GitHub against alanning:roles has the clue you are looking for. You may need to install the check package as it may be an undeclared dependency.
$ meteor add check
challett appears to have fixed this issue:
https://github.com/challett/meteor-roles/commit/dfd967e1e2ea27dc20b34e2bd17f38de70ebed72
//roles/package.js
Package.describe({
summary: "Authorization package for Meteor",
- version: "1.2.12",
+ version: "1.2.13",
git: "https://github.com/alanning/meteor-roles.git",
name: "alanning:roles"
});
## -8,7 +8,7 ## Package.describe({
Package.on_use(function (api) {
api.versionsFrom && api.versionsFrom("METEOR#0.9.0");
var both = ['client', 'server'];
- api.use(['underscore', 'accounts-base'], both);
+ api.use(['underscore', 'accounts-base', 'check'], both);
api.use(['handlebars'], 'client', {weak: true});
Related
So I've done the todo and leaderboard tutorials and now am excited to begin routing - seems like iron router is the way to go so I install it to my project using
mrt add iron-router
Seems to install ok so I start meteor and navigate to localhost:3000 and my console lights up with:
Uncaught TypeError: undefined is not a function
helpers.js:141 Uncaught TypeError: Cannot read property 'prototype' of undefined
router.js:61 Uncaught TypeError: undefined is not a function
global-imports.js?784bc180a149e4c10dff977a7f114df67d9952c6:3 Uncaught TypeError: Cannot read property 'RouteController' of undefined
template.tutorialexample.js?e119ff8df948cfe8167f49eb28794995a594841c:2 Uncaught ReferenceError: Template is not defined
tutorialexample.js?a4ef596255404350be2cc45303caea02f934cd17:1 Uncaught ReferenceError: Meteor is not defined
Mind you this is a default app, haven't touched a thing.
So if someone could point me in the right direction that would be great. I did read somewhere that I should be using 0.8.2 version of iron router - and I then did change my smart.json file to contain:
{
"packages": {
"iron-router": "0.8.2"
}
}
and then did meteor update etc but still no luck. So any help anyone could provide would be great.
Meteor has changed quite a bit & the instructions/tutorial you've been following is a bit dated.
Previously mrt was part of the meteorite packaging system, from Meteor 0.9.0 it has been integrated directly into meteor.
So now you do:
meteor add iron:router
To add it to your project. Once you start your app up it should present a basic template on how to use it.
I'm getting the following error - Uncaught ReferenceError: Tracker is not defined
I am running meteor under windows(meteor version 0.8.3).
The code is in my templates js file.
Tracker.autorun(function (c) {
if (MovieTrailers.find().fetch().length == 0)
return;
c.stop();
PlayCurrentTrailer();
});
So far I have tried :
meteor add deps
But that didn't work.
Is tracker available under 0.8.3? or am I missing a package?
tracker is the new name of deps, so replace the occurrence of tracker in your code with deps and you're good to go.
Try to avoid running older versions of Meteor to develop new code, can't you run a VM or use an online service like Nitrous.io for development purpose, as deploying a Meteor app to production in a Windows environment for the moment is not going to happen anytime soon ?
I am experimenting with Meteor and iron:router. I git cloned the examples from https://github.com/EventedMind/iron-router.git. I then cd-ed into samples/basic, and ran meteor update and meteor. My meteor version is 0.9.3.1
When I navigated to the website an error is displayed in console and the page is empty. The error is as below:
Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
at null._render (http://localhost:3000/packages/iron_dynamic-template.js?32038885cb1dad7957291ffebfffcb7f8cd57d20:239:17)
at doRender (http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:1853:25)
at http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:1795:16
at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:2029:12)
at viewAutorun (http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:1794:18)
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:10)
at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:11)
at Blaze.View.autorun (http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:1793:19)
at http://localhost:3000/packages/blaze.js?7b7ff7ee2ccdccd85a1ad0d8dc9d96193e29e8b0:1847:10 debug.js:41
Can someone kindly advise what I am doing incorrectly?
Thanks in advance.
The reason you have this issue is there is a discrepancy between the iron-router#1.0.0-pre-x (like a Beta for 1.0) and the currently in use 0.9.x version of iron router.
The old notation for defining a route for http://localhost:3000/route, for the template route would be as follows:
Router.route("route", { path : '/' });
However in the new version, which is currently on github on devel (which I presume the examples are based on is as follows):
Router.route("/", function() {
this.render("route");
});
The problem is using the notation on the bottom would lead to the error Couldn't find a template named "/" since the first param of the Route.route is now a path instead of a template.
The way to fix this is to either use the pre-release version of iron router (the version string can be found in the package.js file on github):
meteor remove iron:router
meteor add iron:router#1.0.0-pre3
Or to use the old notation by looking at an example bundled with a release on github instead of the devel branch like this one: https://github.com/EventedMind/iron-router/tree/v0.9.2-rc0
I tried to install Kadira on a meteor application.
mrt add kadira
Ok
Kadira.connect('<appId>', '<appSecret>')
Ok
But, this is the error I have :
app/server/kadira.js:7
console.log( Kadira );
^
ReferenceError: Kadira is not defined
at app/server/kadira.js:7:16
at null._onTimeout (packages/underscore/underscore.js:673)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
=> Exited with code: 8
And I don't understand how this is possible.
I checked the package and it exports the namespace as it should :
Package.on_use(function(api) {
configurePackage(api);
api.export(['Kadira']);
});
Meteorite can sometimes be a little quirky.
Check your smart.json to see if it contains kadira
Check .meteor/packages to see if it contains kadira, if not add it.
Delete smart.lock and run mrt install once more.
i try to deploy my meteor application, but it still fail. I use meteor 0.6.1, and its package system.
in my root app, i created the following file tree :
packages
cheerio
package.js
iconv-lite
package.js
here is the content of the package.js :
Package.describe({
summary: 'Cheerio, an html parser with Jquery like API, but server side'
});
Npm.depends({cheerio: '0.10.8'});
and
Package.describe({
summary: 'Encoding management'
});
Npm.depends({'iconv-lite': '0.2.7'});
Then i do a meteor deploy appName, and then a meteor logs appName
and here is the error :
[Tue Apr 09 2013 13:14:59 GMT+0000 (UTC)] INFO ReferenceError: module is not defined
at app/packages/cheerio/index.js:5:11
at /meteor/containers/72e47bd9-1446-3b0f-126d-113dfb566c3c/bundle/server/server.js:282:7
at Array.forEach (native)
at Function._.each._.forEach (/meteor/dev_bundles/0.3.0/lib/node_modules/underscore/underscore.js:79:11)
at run (/meteor/containers/72e47bd9-1446-3b0f-126d-113dfb566c3c/bundle/server/server.js:227:7)
So i get a problem because the var module is not defined in the js file.
I don't know what to do, and any help would be great.
Thanks
Based on this website: meteor-npm-integration, i wrote a little subject to explain a little bit more the system of meteor Npm package: tumblr.
I think you still need at least one js file that you add using api.add_files from package.js, which you have it doing the Npm.require