升级到Meteor 1.1.0.3后,我在加载时收到此错误:
W20150903-07:55:45.040(1)? (STDERR)
W20150903-07:55:45.040(1)? (STDERR) /Users/me/.meteor/packages/meteor-tool/.1.1.4.rrtb94++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150903-07:55:45.041(1)? (STDERR) throw(ex);
W20150903-07:55:45.041(1)? (STDERR) ^
W20150903-07:55:45.049(1)? (STDERR) Error: changePwd route configured but enablePasswordChange set to false!
W20150903-07:55:45.049(1)? (STDERR) at [object Object].AccountsTemplates.configureRoute (packages/useraccounts:iron-routing/lib/core.js:113:1)
W20150903-07:55:45.049(1)? (STDERR) at app/lib/config/at_config.js:2:19
W20150903-07:55:45.049(1)? (STDERR) at app/lib/config/at_config.js:34:3
W20150903-07:55:45.049(1)? (STDERR) at /Users/me/code/js/meteor/ssc/.meteor/local/build/programs/server/boot.js:222:10
W20150903-07:55:45.049(1)? (STDERR) at Array.forEach (native)
W20150903-07:55:45.049(1)? (STDERR) at Function._.each._.forEach (/Users/me/.meteor/packages/meteor-tool/.1.1.4.rrtb94++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150903-07:55:45.050(1)? (STDERR) at /Users/me/code/js/meteor/ssc/.meteor/local/build/programs/server/boot.js:117:5
我的router.js
文件位于顶部,之前工作正常:
AccountTemplates.configure AccountTemplates.configure Router.configure({
layoutTemplate: 'layout',
});
我已遵循建议,例如on this question但我仍然收到错误。
我当前的router.js
文件现在有各种各样的内容来尝试修复问题,我尝试过多次订购和重新排序。整个文件看起来像这样:
AccountsTemplates.configure({
defaultLayout: 'layout',
showForgotPasswordLink: true,
overrideLoginErrors: true,
enablePasswordChange: true,
sendVerificationEmail: false,
});
Router.route('/', function() {
this.render('home');
});
Router.route('/user/:_username', {
name: 'user_profile',
data: function() { return Meteor.user();}
});
Router.route('/create', function() {
this.render('createEvent');
}, {
name: 'create'
});
Router.onBeforeAction(function () {
if (!Meteor.userId()) {
// if the user is not logged in, render the Login template
this.render('home');
} else {
// otherwise don't hold up the rest of hooks or our route/action function
// from running
this.next();
}
}, {
only: ['create']
});
Router.route('/insert', function() {
this.render('insertEvent');
});
Router.route('/events/:slug', {
name: 'event',
data: function() { return Events.findOne({slug: this.params.slug});}
});
Router.route('/useremail', function() {
this.render('userEmail');
}, {
name: 'userEmail'
});
Router._filters = {
hasCompletedProfile: function() {
if(!this.ready()) return;
var user = Meteor.user();
if (user && ! userProfileComplete(user)){
this.render('userEmail');
} else {
this.next();
}
},
};
// copied from Telesc.pe router.js
filters = Router._filters;
Router.onBeforeAction(filters.hasCompletedProfile);
Router.configure({
layoutTemplate: 'layout',
});
AccountsTemplates.configureRoute('changePwd');
AccountsTemplates.configureRoute('enrollAccount');
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('signIn');
AccountsTemplates.configureRoute('signUp');
AccountsTemplates.configureRoute('verifyEmail');
我该怎么办?