2016-03-23 2 views
3

が定義されていない、私はそう (としてのベースディレクトリにしようとしたように、私は、postSignUpHook機能を使用しようとしていますAccountsTemplatesは流星のブランドの新しいWindowsのインストールとパッケージの最も単純で

ReferenceError: AccountsTemplates is not defined

を取得していますウェル/サーバー/)として

ここ
AccountsTemplates.configure({ 
    postSignUpHook: myPostSubmitFunc 
}); 

var myPostSubmitFunc = function(userId, info) { 
    console.log("new user " + userId); 
} 

は流星を使用してインストールされているバージョンがインストールされ

meteor list 
accounts-base   1.2.2 A user account system 
accounts-password  1.1.4 Password support for accounts 
accounts-ui   1.1.6 Simple templates to add login widgets to an app 
alanning:roles  1.2.15 Authorization package for Meteor 
blaze-html-templates 1.0.1 Compile HTML templates into reactive UI with 
    Meteor Blaze 
ecmascript   0.1.6* Compiler plugin that supports ES2015+ in all 
    .js files 
es5-shim    4.1.14 Shims and polyfills to improve ECMAScript 5  
    support 
insecure    1.0.4 (For prototyping only) Allow all database  
    writes from the client 
jquery    1.11.4 Manipulate the DOM using CSS selectors 
meteor-base   1.0.1 Packages that every Meteor app needs 
mobile-experience  1.0.1 Packages for a great mobile user experience 
mongo     1.1.3 Adaptor for using MongoDB and Minimongo over  
    DDP 
session    1.1.1 Session variable 
standard-minifiers 1.0.2 Standard minifiers used with Meteor apps by  
    default. 
tracker    1.0.9 Dependency tracker to allow reactive callbacks 

AccountsTemplatesはアカウントベースから来ていると言えますが、実際に作成された場所を見つけるのは難しいです。

また、私は正しく覚えていますが、このような参照エラーが見つからない場合は、互換性のないパッケージには関係のない別の問題がありますか?ここで何が起こっているのかをデバッグするにはどうすればいいですか?

+1

(docs.meteor.comは実際には、その方法はAccountsServerに存在しないように気をつけ、一見誤っAccountsCommon#onLoginを持っています) : 'AccountsTemplates'を使うためのフロールーティングパッケージ。 [Ref](https://github.com/meteor-useraccounts/core/blob/master/Guide.md#routing)。 –

答えて

1

guide.meteor.comがuseraccounts:flow-routingの使用を想定しているので、私は混乱していたと思います。

私が見ておくべきことは、accountsセクションのdocs.meteor.comです。

具体的には、新規ユーザーの作成後にAccounts.onLoginを使用して役割を追加すると思います。その時点でuserIdが生成されていないため、AccountsServer#onCreateUserを使用することはできません。鉄routing`のか `useraccounts:

は、あなたが` useraccountsを使用する必要が