Meteor method defined in lib, can't be found under server/lib -
i have method defined in lib/methods.js:
meteor.methods({ gettask: function( extraparam ) { return {dummy: 'dummy'}; } });
but when call server/lib/environment.js:
meteor.call( "gettask", extraparam );
i'm getting method not found, under impression lib/ loaded before server/lib,
or should call method in server/main.js ?
with respect issue, load order rules work follows:
- paths containing lib gain priority.
- paths gain priority based on depth.
combining 2 shows /server/lib/x.js
loaded before /lib/x.js
. methods shouldn't issue unless method invoked containing file executed.
your options are:
- fix load order moving call suggested.
main.js
loaded last work. - call method within meteor.startup callback.
Comments
Post a Comment